Package alpine.server.auth
Class OidcAuthenticationService
java.lang.Object
alpine.server.auth.OidcAuthenticationService
- All Implemented Interfaces:
AuthenticationService
- Since:
- 1.8.0
-
Constructor Summary
ConstructorsConstructorDescriptionOidcAuthenticationService(String accessToken) Deprecated.OidcAuthenticationService(String idToken, String accessToken) -
Method Summary
Modifier and TypeMethodDescriptionAuthenticate aPrincipalusing the provided credentials.booleanDefines a method which returns if the specified piece of data, required to perform authentication is present.
-
Constructor Details
-
OidcAuthenticationService
Deprecated.UseOidcAuthenticationService(String, String)instead- Parameters:
accessToken- The access token acquired by authenticating with an IdP
-
OidcAuthenticationService
- Parameters:
idToken- The ID token acquired by authenticating with an IdPaccessToken- The access token acquired by authenticating with an IdP- Since:
- 1.10.0
-
-
Method Details
-
isSpecified
public boolean isSpecified()Description copied from interface:AuthenticationServiceDefines a method which returns if the specified piece of data, required to perform authentication is present.- Specified by:
isSpecifiedin interfaceAuthenticationService- Returns:
- true if the authentication data was specified, false if not
-
authenticate
Authenticate aPrincipalusing the provided credentials.If an ID token is provided, Alpine will validate it and source configured claims from it.
If an access token is provided, Alpine will call the IdP's
/userinfoendpoint with it to verify its validity, and source configured claims from the response.If both access token and ID token are provided, the ID token takes precedence. When all configured claims are found in the ID token,
/userinfowon't be requested. When not all claims were found in the ID token,/userinfowill be requested supplementary.- Specified by:
authenticatein interfaceAuthenticationService- Returns:
- An authenticated
Principal - Throws:
AlpineAuthenticationException- When authentication failed
-
OidcAuthenticationService(String, String)instead