lpotthast / axum-keycloak-auth

Protect axum routes with a JWT emitted by Keycloak.
https://crates.io/crates/axum-keycloak-auth
Apache License 2.0
34 stars 13 forks source link

Custom attributes #1

Closed sillen102 closed 1 year ago

sillen102 commented 1 year ago

How can I access custom attributes? I have set the persist_raw_claims(true) but now what?

I have tried reading the code and in the code if persist_raw_claims is set there should be a tuple looking like so: (RawClaims, KeycloakToken<String>) but doing this in a handler function isn't working: Extension<(RawClaims, KeycloakToken<String>)>.

sillen102 commented 1 year ago

Ok, I think I figured it out. You have to do two separate extractors, one for KeycloakToken and one for RawClaims.