Package org.forgerock.openidconnect
Class Client
- java.lang.Object
-
- org.forgerock.json.JsonValue
-
- org.forgerock.openidconnect.Client
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClient.ApplicationTypeStores a client application type.static classClient.ClientTypeStores the possible OAuth2Client types.static classClient.PublicKeySelectorStores the selected public key locator for this client.static classClient.SubjectTypeStores a Client SubjectType.static classClient.TokenEndpointAuthMethodStores a token endpoint auth method type.
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIRMED_MAX_AGEstatic longMIN_DEFAULT_MAX_AGE
-
Constructor Summary
Constructors Constructor Description Client(String clientID, String clientType, List<String> redirectionURIs, List<String> allowedGrantScopes, List<String> defaultGrantScopes, List<String> displayName, List<String> displayDescription, List<String> clientName, String subjectType, String idTokenSignedResponseAlgorithm, List<String> postLogoutRedirectionURIs, String accessToken, String clientSessionURI, String applicationType, String clientSecret, List<String> responseTypes, List<String> contacts, Long defaultMaxAge, Boolean defaultMaxAgeEnabled, String tokenEndpointAuthMethod, String jwks, String jwksUri, String x509, String selector, String sectorIdUri, Long authorizationCodeLifeTime, Long accessTokenLifeTime, Long refreshTokenLifeTime, Long jwtTokenLifeTime)Creates a OAuth2Client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessToken()Gets the registration access token of the OAuth2Client.LonggetAccessTokenLifeTime()Gets the access token lifetime of the OAuth2Client.Set<String>getAllowedGrantScopes()Gets the allowed scopes of the OAuth2Client.Client.ApplicationTypegetApplicationType()Gets the application type of the OAuth2Client.LonggetAuthorizationCodeLifeTime()Gets the authorization code lifetime of the OAuth2Client.StringgetClientID()Gets the client id of the OAuth2Client.Set<String>getClientName()Gets the client names of the OAuth2Client.StringgetClientSecret()Gets the client secret of the OAuth2Client.StringgetClientSessionURI()Gets the client session uri of the OAuth2Client.Client.ClientTypegetClientType()Gets the client type of the OAuth2Client.Set<String>getContacts()Gets the contacts.Set<String>getDefaultGrantScopes()Gets the default scopes of the OAuth2Client.LonggetDefaultMaxAge()Gets the default max age of the OAuth2Client.BooleangetDefaultMaxAgeEnabled()Gets whether the max age value is enforced.Set<String>getDisplayDescription()Gets the client descriptions of the OAuth2Client.Set<String>getDisplayName()Gets the display names of the OAuth2Client.StringgetIdTokenSignedResponseAlgorithm()Gets the id token signed response alg of the OAuth2Client.StringgetJwks()Gets JWKs for this client.StringgetJwksUri()Gets JWKs_URI for this client.LonggetJwtTokenLifeTime()Gets the JWT token lifetime of the OAuth2Client.StringgetKeySelector()Returns the key selector for this client.List<String>getPostLogoutRedirectionURIs()Gets the post logout redirection uri of the OAuth2Client.Set<URI>getRedirectionURIs()Gets the redirection uris of the OAuth2Client.Set<String>getRedirectionURIsAsString()Gets the redirection uris of the OAuth2Client.LonggetRefreshTokenLifeTime()Gets the refresh token lifetime of the OAuth2Client.Set<String>getResponseTypes()Gets the response types.StringgetSectorIdUri()Returns the sector id uri for this client if set.Client.SubjectTypegetSubjectType()Gets the subject type of the OAuth2Client.Client.TokenEndpointAuthMethodgetTokenEndpointAuthMethod()Gets the token endpoint auth method.StringgetX509()Gets X509 certificate for this client.booleanhasAccessToken()Indicates whether this client has a registration access token or not.voidsetAccessToken(String accessToken)Sets the registration access token of the OAuth2Client.voidsetAccessTokenLifeTime(Long accessTokenLifeTime)Sets the access token lifetime of the OAuth2Client.voidsetAllowedGrantScopes(List<String> allowedGrantScopes)Sets the allowed scopes of the OAuth2Client.voidsetApplicationType(String applicationType)Sets the application type of the OAuth2Client.voidsetAuthorizationCodeLifeTime(Long authorizationCodeLifeTime)Sets the authorization code lifetime of the OAuth2Client.voidsetClientID(String clientID)Sets the client id of the OAuth2Client.voidsetClientName(List<String> clientName)Sets the client names of the OAuth2Client.voidsetClientSecret(String clientSecret)Sets the client secret of the OAuth2Client.voidsetClientSessionURI(String clientSessionURI)Sets the client session uri of the OAuth2Client.voidsetClientType(String clientType)Sets the client type of the OAuth2Client.voidsetContacts(List<String> contacts)Sets the contacts of the OAuth2Client.voidsetDefaultGrantScopes(List<String> defaultGrantScopes)Sets the default scopes of the OAuth2Client.voidsetDefaultMaxAge(Long defaultMaxAge)Sets the default max age of the OAuth2Client.voidsetDefaultMaxAgeEnabled(Boolean defaultMaxAgeEnabled)Sets whether the default max age value is to be utilised.voidsetDisplayDescription(List<String> displayDescription)Sets the client descriptions of the OAuth2Client.voidsetDisplayName(List<String> displayName)Sets the display names of the OAuth2Client.voidsetIdTokenSignedResponseAlgorithm(String idTokenSignedResponseAlgorithm)Sets the id token signed response alg of the OAuth2Client.voidsetJwtTokenLifeTime(Long jwtTokenLifeTime)Sets the JWT token lifetime of the OAuth2Client.voidsetPostLogoutRedirectionURIs(List<String> postLogoutRedirectionURIs)Sets the post logout redirection uri of the OAuth2Client.voidsetRedirectionURIs(List<String> redirectionURIs)Sets the redirection uris of the OAuth2Client.voidsetRefreshTokenLifeTime(Long refreshTokenLifeTime)Sets the refresh token lifetime of the OAuth2Client.voidsetResponseTypes(List<String> responseTypes)Sets the response types of the OAuth2Client.voidsetSectorIdUri(String sectorIdUri)Sets the sector id uri.voidsetSubjectType(String subjectType)Sets the subject type of the OAuth2Client.voidsetTokenEndpointAuthMethod(String tokenEndpointAuthMethod)Sets the token endpoint auth method.-
Methods inherited from class org.forgerock.json.JsonValue
add, add, add, add, addPermissive, array, as, asBigDecimal, asBoolean, asCollection, asCollection, asDouble, asEnum, asInteger, asList, asList, asLong, asMap, asMap, asMapOfList, asNumber, asSet, asSet, asString, asURI, clear, clone, contains, copy, defaultTo, diff, expect, field, fieldIfNotNull, get, get, get, getObject, getPointer, isBoolean, isCollection, isDefined, isEqualTo, isList, isMap, isNotNull, isNull, isNumber, isSet, isString, iterator, json, keys, object, object, patch, put, put, put, putPermissive, remove, remove, remove, required, set, setObject, size, toIndex, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
MIN_DEFAULT_MAX_AGE
public static final long MIN_DEFAULT_MAX_AGE
- See Also:
- Constant Field Values
-
CONFIRMED_MAX_AGE
public static final String CONFIRMED_MAX_AGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Client
public Client(String clientID, String clientType, List<String> redirectionURIs, List<String> allowedGrantScopes, List<String> defaultGrantScopes, List<String> displayName, List<String> displayDescription, List<String> clientName, String subjectType, String idTokenSignedResponseAlgorithm, List<String> postLogoutRedirectionURIs, String accessToken, String clientSessionURI, String applicationType, String clientSecret, List<String> responseTypes, List<String> contacts, Long defaultMaxAge, Boolean defaultMaxAgeEnabled, String tokenEndpointAuthMethod, String jwks, String jwksUri, String x509, String selector, String sectorIdUri, Long authorizationCodeLifeTime, Long accessTokenLifeTime, Long refreshTokenLifeTime, Long jwtTokenLifeTime)
Creates a OAuth2Client.- Parameters:
clientID- The client id of the client.clientType- The client type of the client.redirectionURIs- The redirection uris of the client.allowedGrantScopes- The allowed scopes of the client.defaultGrantScopes- The default scopes of the client.displayName- The display name of the clientdisplayDescription- The client description of the client.clientName- The client name of the client.subjectType- The subject type of the client.idTokenSignedResponseAlgorithm- The id token signed response algorithm of the client.postLogoutRedirectionURIs- The post logout redirect URIs of the client.accessToken- The registration access token of the client.clientSessionURI- The client session uri of the client.applicationType- The application type of the client.clientSecret- The client secret of the client.responseTypes- The response types of the client.contacts- The contact information for the client (can be null).defaultMaxAge- The default maximum age a session can be when authorizing, in seconds.defaultMaxAgeEnabled- Whether we enforce the defaultMaxAge parameter or not.tokenEndpointAuthMethod- The token endpoint's authentication method.jwks- The client's public key jwks.jwksUri- The client's public key jwks_uri.x509- The client's public key x509.selector- Selector for the public key format.sectorIdUri- Client's sector ID Uri.authorizationCodeLifeTime- The client's authorization code lifetime.accessTokenLifeTime- The client's access token lifetime.refreshTokenLifeTime- The client's refresh token lifetime.jwtTokenLifeTime- The client's JWT token lifetime.
-
-
Method Detail
-
getJwks
public String getJwks()
Gets JWKs for this client.
-
getJwksUri
public String getJwksUri()
Gets JWKs_URI for this client.
-
getX509
public String getX509()
Gets X509 certificate for this client.
-
getKeySelector
public String getKeySelector()
Returns the key selector for this client.
-
getClientID
public String getClientID()
Gets the client id of the OAuth2Client.- Returns:
- The client id.
-
getDefaultMaxAge
public Long getDefaultMaxAge()
Gets the default max age of the OAuth2Client.- Returns:
- the default max age.
-
getDefaultMaxAgeEnabled
public Boolean getDefaultMaxAgeEnabled()
Gets whether the max age value is enforced.- Returns:
- true if enforced, false otherwise.
-
setClientID
public void setClientID(String clientID)
Sets the client id of the OAuth2Client.- Parameters:
clientID- The client id.
-
getClientType
public Client.ClientType getClientType()
Gets the client type of the OAuth2Client. If the client type isnull,nullis returned.- Returns:
- The client type.
-
setClientType
public void setClientType(String clientType)
Sets the client type of the OAuth2Client.- Parameters:
clientType- The client type.
-
getRedirectionURIs
public Set<URI> getRedirectionURIs()
Gets the redirection uris of the OAuth2Client. If the redirection uris isnull,nullis returned.- Returns:
- The redirection uris as URIs.
-
getRedirectionURIsAsString
public Set<String> getRedirectionURIsAsString()
Gets the redirection uris of the OAuth2Client. If the redirection uris isnull,nullis returned.- Returns:
- The redirection uris as Strings.
-
setRedirectionURIs
public void setRedirectionURIs(List<String> redirectionURIs)
Sets the redirection uris of the OAuth2Client.- Parameters:
redirectionURIs- The redirection uris.
-
setSectorIdUri
public void setSectorIdUri(String sectorIdUri)
Sets the sector id uri.
-
getSectorIdUri
public String getSectorIdUri()
Returns the sector id uri for this client if set.
-
getAllowedGrantScopes
public Set<String> getAllowedGrantScopes()
Gets the allowed scopes of the OAuth2Client. If the allowed scopes isnull,nullis returned.- Returns:
- The allowed scopes.
-
setAllowedGrantScopes
public void setAllowedGrantScopes(List<String> allowedGrantScopes)
Sets the allowed scopes of the OAuth2Client.- Parameters:
allowedGrantScopes- The allowed scopes.
-
getDefaultGrantScopes
public Set<String> getDefaultGrantScopes()
Gets the default scopes of the OAuth2Client. If the default scopes isnull,null, is returned.- Returns:
- The default scopes.
-
setDefaultGrantScopes
public void setDefaultGrantScopes(List<String> defaultGrantScopes)
Sets the default scopes of the OAuth2Client.- Parameters:
defaultGrantScopes- The default scopes.
-
getDisplayName
public Set<String> getDisplayName()
Gets the display names of the OAuth2Client. If the display names isnull,nullis returned.- Returns:
- The display names.
-
setDisplayName
public void setDisplayName(List<String> displayName)
Sets the display names of the OAuth2Client.- Parameters:
displayName- The display names.
-
getDisplayDescription
public Set<String> getDisplayDescription()
Gets the client descriptions of the OAuth2Client. If the client descriptions isnull,nullis returned.- Returns:
- The client descriptions.
-
setDisplayDescription
public void setDisplayDescription(List<String> displayDescription)
Sets the client descriptions of the OAuth2Client.- Parameters:
displayDescription- The client descriptions.
-
getClientName
public Set<String> getClientName()
Gets the client names of the OAuth2Client. If the client name isnull,nullis returned.- Returns:
- The client names.
-
setClientName
public void setClientName(List<String> clientName)
Sets the client names of the OAuth2Client.- Parameters:
clientName- The client names.
-
getSubjectType
public Client.SubjectType getSubjectType()
Gets the subject type of the OAuth2Client.- Returns:
- The subject type.
-
setSubjectType
public void setSubjectType(String subjectType)
Sets the subject type of the OAuth2Client.- Parameters:
subjectType- The subject type.
-
getIdTokenSignedResponseAlgorithm
public String getIdTokenSignedResponseAlgorithm()
Gets the id token signed response alg of the OAuth2Client.- Returns:
- The id token signed response alg.
-
setIdTokenSignedResponseAlgorithm
public void setIdTokenSignedResponseAlgorithm(String idTokenSignedResponseAlgorithm)
Sets the id token signed response alg of the OAuth2Client.
If the specified idTokenSignedResponseAlgorithm isnullthe value is defaulted to 'HS256'.- Parameters:
idTokenSignedResponseAlgorithm- The id token signed response alg.
-
getPostLogoutRedirectionURIs
public List<String> getPostLogoutRedirectionURIs()
Gets the post logout redirection uri of the OAuth2Client. If the logout redirection uri isnull,nullis returned.- Returns:
- The post logout redirection uri.
-
setPostLogoutRedirectionURIs
public void setPostLogoutRedirectionURIs(List<String> postLogoutRedirectionURIs)
Sets the post logout redirection uri of the OAuth2Client.- Parameters:
postLogoutRedirectionURIs- The post logout redirection uri.
-
getAccessToken
public String getAccessToken()
Gets the registration access token of the OAuth2Client. If the registration access token isnull,nullis returned.- Returns:
- The registration access token.
-
setAccessToken
public void setAccessToken(String accessToken)
Sets the registration access token of the OAuth2Client.- Parameters:
accessToken- The registration access token.
-
hasAccessToken
public boolean hasAccessToken()
Indicates whether this client has a registration access token or not.
-
getClientSessionURI
public String getClientSessionURI()
Gets the client session uri of the OAuth2Client. If the client session uri isnull,nullis returned.- Returns:
- The client session uri.
-
setClientSessionURI
public void setClientSessionURI(String clientSessionURI)
Sets the client session uri of the OAuth2Client.- Parameters:
clientSessionURI- The client session uri.
-
getApplicationType
public Client.ApplicationType getApplicationType()
Gets the application type of the OAuth2Client. If the application type isnull,nullis returned.- Returns:
- The application type.
-
setApplicationType
public void setApplicationType(String applicationType)
Sets the application type of the OAuth2Client.- Parameters:
applicationType- The application type.
-
getClientSecret
public String getClientSecret()
Gets the client secret of the OAuth2Client. If the client secret isnull,nullis returned.- Returns:
- The client's secret.
-
setClientSecret
public void setClientSecret(String clientSecret)
Sets the client secret of the OAuth2Client.- Parameters:
clientSecret- The client's secret.
-
getResponseTypes
public Set<String> getResponseTypes()
Gets the response types. If the response types value isnull,nullwill be returned.- Returns:
- A
Setof response types.
-
setResponseTypes
public void setResponseTypes(List<String> responseTypes)
Sets the response types of the OAuth2Client.- Parameters:
responseTypes- The response types.
-
setDefaultMaxAgeEnabled
public void setDefaultMaxAgeEnabled(Boolean defaultMaxAgeEnabled)
Sets whether the default max age value is to be utilised.- Parameters:
defaultMaxAgeEnabled- The default max age.
-
getTokenEndpointAuthMethod
public Client.TokenEndpointAuthMethod getTokenEndpointAuthMethod()
Gets the token endpoint auth method.- Returns:
- The token endpoint auth method.
-
setTokenEndpointAuthMethod
public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod)
Sets the token endpoint auth method.- Parameters:
tokenEndpointAuthMethod- the token endpoint auth method to use.
-
setDefaultMaxAge
public void setDefaultMaxAge(Long defaultMaxAge)
Sets the default max age of the OAuth2Client. Minimum enforced value of 60.- Parameters:
defaultMaxAge- The default max age.
-
getContacts
public Set<String> getContacts()
Gets the contacts. If the contacts value isnull,nullwill be returned.- Returns:
- A
Setof contacts
-
setContacts
public void setContacts(List<String> contacts)
Sets the contacts of the OAuth2Client.- Parameters:
contacts- The contacts.
-
getAuthorizationCodeLifeTime
public Long getAuthorizationCodeLifeTime()
Gets the authorization code lifetime of the OAuth2Client.- Returns:
- the authorization code lifetime.
-
setAuthorizationCodeLifeTime
public void setAuthorizationCodeLifeTime(Long authorizationCodeLifeTime)
Sets the authorization code lifetime of the OAuth2Client.- Parameters:
authorizationCodeLifeTime- The authorization code lifetime.
-
getAccessTokenLifeTime
public Long getAccessTokenLifeTime()
Gets the access token lifetime of the OAuth2Client.- Returns:
- the access token lifetime.
-
setAccessTokenLifeTime
public void setAccessTokenLifeTime(Long accessTokenLifeTime)
Sets the access token lifetime of the OAuth2Client.- Parameters:
accessTokenLifeTime- The access token lifetime.
-
getRefreshTokenLifeTime
public Long getRefreshTokenLifeTime()
Gets the refresh token lifetime of the OAuth2Client.- Returns:
- the refresh token lifetime.
-
setRefreshTokenLifeTime
public void setRefreshTokenLifeTime(Long refreshTokenLifeTime)
Sets the refresh token lifetime of the OAuth2Client.- Parameters:
refreshTokenLifeTime- The refresh token lifetime.
-
getJwtTokenLifeTime
public Long getJwtTokenLifeTime()
Gets the JWT token lifetime of the OAuth2Client.- Returns:
- the JWT token lifetime.
-
setJwtTokenLifeTime
public void setJwtTokenLifeTime(Long jwtTokenLifeTime)
Sets the JWT token lifetime of the OAuth2Client.- Parameters:
jwtTokenLifeTime- The JWT token lifetime.
-
-