public class OIDCCredentials
extends java.lang.Object
| Constructor and Description |
|---|
OIDCCredentials() |
OIDCCredentials(java.lang.String serialisedCredential)
OpenID Connect credentials containing the identity, refresh and access tokens provided on a
successful authentication with OpenID Connect.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkValidAuth()
Check whether the user is authorized and not expired.
|
static OIDCCredentials |
deserialize(java.lang.String serializedCredential)
Return a new credential from the output of
serialize() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAccessToken() |
java.lang.String |
getIdentityToken() |
boolean |
getNeedsRenewal()
Check whether new access token is needed.
|
java.lang.String |
getRefreshToken() |
int |
hashCode() |
boolean |
isAuthorized()
Check if the user is authenticated/authorized.
|
boolean |
isExpired()
Returns whether this token is expired or not.
|
boolean |
renew()
Renew the token.
|
java.lang.String |
serialize()
Returns stringified JSON for the OIDCCredential.
|
void |
setNeedsRenewal()
Force request of new access token.
|
boolean |
verifyClaims(org.jose4j.jwk.JsonWebKeySet jwks,
KeycloakConfiguration keycloakConfig)
Verify the token and its claims against the given Keycloak configuration
|
public OIDCCredentials(java.lang.String serialisedCredential)
serialisedCredential - JSON string representation of the authState field produced by
deserialize(String).java.lang.IllegalArgumentException - if deserializing failspublic OIDCCredentials()
public java.lang.String getAccessToken()
public java.lang.String getIdentityToken()
public java.lang.String getRefreshToken()
public boolean verifyClaims(org.jose4j.jwk.JsonWebKeySet jwks,
KeycloakConfiguration keycloakConfig)
jwks - json web keys to verifykeycloakConfig - keycloak config containing certificate information for the jwks
instance.public boolean isExpired()
public boolean getNeedsRenewal()
public void setNeedsRenewal()
public boolean isAuthorized()
true if the user is authenticated/authorized.public java.lang.String serialize()
java.lang.IllegalStateException - if the auth state can not be serializedpublic static OIDCCredentials deserialize(java.lang.String serializedCredential)
serialize()serializedCredential - serialized credential from serialize()java.lang.IllegalArgumentException - if the serailized credentials can not be deserializedpublic boolean checkValidAuth()
public boolean renew()
throws AuthenticationException
java.lang.UnsupportedOperationException - this operation is not implementedAuthenticationException - this operation is not implementedpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object