Skip to content

403 even though PassthroughAction Pass is set #14

@b-dreissigacker

Description

@b-dreissigacker

Hi,
I'm using version "0.4.2".
I set up KeycloakAuth as follows:

KeycloakAuth {
    detailed_responses: true,
    passthrough_policy: |e: &AuthError| match e {
        AuthError::NoAuthorizationHeader => PassthroughAction::Pass,
        _ => PassthroughAction::Return,
    },
    keycloak_oid_public_key: DecodingKey::from_rsa_pem(
        config.keycloak_pk.as_bytes(),
    )
    .unwrap(),
    required_roles: vec![],
};
web::resource("/")
    .guard(guard::Post())
    // .wrap(keycloak_auth)
    .to(public_api),

I would expect that requests without authorization would be passed on to the public_api handler,
but instead I get 403 errors without it being called.

The public_api function calls a graphql schema where some fields are publicly available and others require authorization and return a graphql authorization error.

I tried setting passthrough_policy to AlwaysPassPolicy with the same result.

Am I missing something or is this a bug in version "0.4.2"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions