Class OpenIdCredentials
- All Implemented Interfaces:
Serializable
The credentials of an user to be authenticated with OpenID Connect. This will contain the OpenID ID Token and the OAuth 2.0 Access Token.
This is constructed with an authorization code from the authentication request. This authorization code
is then exchanged using redeemAuthCode(OpenIdConfiguration)
for a response containing the ID Token and Access Token.
The response is then validated against the OpenIdConfiguration
.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdCredentials
(String authCode, String redirectUri) OpenIdCredentials
(Map<String, Object> claims) -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkExpiry
(Map<String, Object> claims) This returns a non-null value only whenredeemAuthCode(OpenIdConfiguration)
has been called and an error occurred.boolean
void
redeemAuthCode
(OpenIdConfiguration configuration) Redeems the Authorization Code with the Token Endpoint to receive an ID Token.
-
Constructor Details
-
OpenIdCredentials
-
OpenIdCredentials
-
-
Method Details
-
getUserId
-
getClaims
-
getResponse
-
getErrorFields
This returns a non-null value only when
redeemAuthCode(OpenIdConfiguration)
has been called and an error occurred.The returned
Fields
will contain an entry forOpenIdAuthenticator.ERROR_PARAMETER
, and optional fields from the response if present, includingerror
,error_description
anderror_uri
.- Returns:
- the error fields or null if no error has occurred.
-
redeemAuthCode
Redeems the Authorization Code with the Token Endpoint to receive an ID Token.
getErrorFields()
should be called directly following this to check if an error occurred.- Parameters:
configuration
- the openIdConfiguration to use.
-
isExpired
public boolean isExpired() -
checkExpiry
-