Package io.hawt.web.auth.oidc
Class OidcLoginModule
java.lang.Object
io.hawt.web.auth.oidc.OidcLoginModule
- All Implemented Interfaces:
LoginModule
This login module operates on Bearer token which contains OAuth2 Access Token. Roles are taken from the
token depending on the flavor of OpenID Connect / OAuth2 used.
For example, Keycloak encodes roles differently depending on use-resource-role-mappings:
use-resource-role-mappings = true: roles come fromresource_access.<client-id>.rolesuse-resource-role-mappings = false: roles come fromrealm_access.roles
roles claim of the access token.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
OidcLoginModule
public OidcLoginModule()
-
-
Method Details
-
initialize
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) - Specified by:
initializein interfaceLoginModule
-
login
- Specified by:
loginin interfaceLoginModule- Throws:
LoginException
-
commit
public boolean commit()- Specified by:
commitin interfaceLoginModule
-
abort
public boolean abort()- Specified by:
abortin interfaceLoginModule
-
logout
- Specified by:
logoutin interfaceLoginModule- Throws:
LoginException
-