I want to leverage Keycloak token validation in my Axum middleware and elsewhere in my application, like websocket authorization. Hence, I've centralized the validation logic in decode.rs and introduced a method in the Keycloak layer for easy JWT token validation with a string reference.
Regarding two updates, I'm uncertain about:
Modifications to the Extra parameter in KeycloakService (service.rs, line 24).
The impact of changes to KeycloakService fields on performance or thread safety. I believe there shouldn't be any issues, but I admit I may not fully grasp all design decisions behind axum-keycloak-auth.
Changes:
Implemented main validation logic in decode.rs (extract_jwt_token function).
Eliminated duplicate fields in KeycloakService, replacing them with a single instance of KeycloakLayer to streamline the code.
Introduced a token validation method in KeycloakLayer to enable token validation outside the Keycloak middleware, enhancing flexibility.
I want to leverage Keycloak token validation in my Axum middleware and elsewhere in my application, like websocket authorization. Hence, I've centralized the validation logic in
decode.rs
and introduced a method in the Keycloak layer for easy JWT token validation with a string reference.Regarding two updates, I'm uncertain about:
Extra
parameter inKeycloakService
(service.rs
, line 24).KeycloakService
fields on performance or thread safety. I believe there shouldn't be any issues, but I admit I may not fully grasp all design decisions behindaxum-keycloak-auth
.Changes:
decode.rs
(extract_jwt_token
function).KeycloakService
, replacing them with a single instance ofKeycloakLayer
to streamline the code.KeycloakLayer
to enable token validation outside the Keycloak middleware, enhancing flexibility.