Package ca.cdr.api.model.json
Class OAuth2WritableClientDetailsJson
java.lang.Object
ca.cdr.api.model.json.OAuth2WritableClientDetailsJson
- All Implemented Interfaces:
IHasAuthorities
,IModelJson
,IModelJson
,Serializable
,ClientDetails
- Direct Known Subclasses:
OAuth2ClientDetailsJson
public class OAuth2WritableClientDetailsJson
extends Object
implements ClientDetails, IHasAuthorities, IModelJson
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface ca.uhn.fhir.model.api.IModelJson
SENSITIVE_DATA_FILTER_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorOAuth2WritableClientDetailsJson
(OAuth2WritableClientDetailsJson theClientDetailsJson) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllowedGrantType
(OAuth2AuthorizedGrantTypeEnum theGrantType) void
addAllowedGrantType
(String theName) void
addAutoApproveScopeIfNotBlank
(String theScope) void
addAutoGrantScopeIfNotBlank
(String theScope) addClientSecret
(OAuth2ClientSecretJson theSecret) addClientSecret
(String theSecret) addClientSecret
(String theSecret, Date theExpiration) void
addPermission
(PermissionEnum thePermission) void
addPermission
(PermissionEnum thePermission, String theArgument) void
addPermission
(GrantedAuthorityJson thePermission) void
addRedirectUrlIfNotBlank
(String theRedirectUrl) addScopeIfNotBlank
(String theScope) The access token validity period for this client.Additional information for this client, not needed by the vanilla OAuth protocol but might be useful, for example, for storing descriptive information.Collection<org.springframework.security.core.GrantedAuthority>
This method is a part of the Spring Security framework, and returns an unmodifiable copy of the client authorities.The grant types for which this client is authorized.The client id.The client secret.getClientSecret
(Long thePid) Returns the authorities that are granted to the user/sessiongetPid()
The refresh token validity period for this client.The pre-defined redirect URI for this client to use during the "authorization_code" access grant.The resources that this client can access.getScope()
The scope of this client.boolean
boolean
boolean
hasScope()
boolean
boolean
boolean
isAutoApprove
(String theScope) Test whether client needs user approval for a particular scope.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isScoped()
Whether this client is limited to a specific scope.boolean
boolean
Whether a secret is required to authenticate this client.void
removePermission
(PermissionEnum thePermission, String theArgument) void
removePermission
(GrantedAuthorityJson thePermission) void
setAccessTokenValiditySeconds
(Integer theAccessTokenValiditySeconds) void
setAllowedGrantTypes
(TreeSet<OAuth2AuthorizedGrantTypeEnum> theAllowedGrantTypes) void
setAlwaysRequireApproval
(boolean theAlwaysRequireApproval) void
setArchivedAt
(Date theArchivedAt) void
setAttestationAccepted
(boolean theAttestationAccepted) void
setAutoApproveScopes
(TreeSet<String> theAutoApproveScopes) void
setAutoGrantScopes
(TreeSet<String> theAutoGrantScopes) void
setCanIntrospectAnyTokens
(boolean theCanIntrospectAnyTokens) void
setCanIntrospectOwnTokens
(boolean theCanIntrospectOwnTokens) void
setCanReissueTokens
(boolean theCanReissueTokens) setClientId
(String theClientId) void
setClientName
(String theClientName) void
setClientSecrets
(List<OAuth2ClientSecretJson> theClientSecrets) void
setCreatedByAppSphere
(boolean theCreatedByAppSphere) void
setEnabled
(boolean theEnabled) void
setFixedScope
(boolean theFixedScope) void
setJwksUrl
(String theJwksUrl) void
setPermissions
(List<GrantedAuthorityJson> thePermissions) void
setPublicJwks
(String thePublicJwks) void
setRefreshTokenValiditySeconds
(Integer theRefreshTokenValiditySeconds) void
setRegisteredRedirectUris
(Iterable<String> theRegisteredRedirectUri) void
setRegisteredRedirectUris
(TreeSet<String> theRegisteredRedirectUris) void
setRememberApprovedScopes
(boolean theRememberApprovedScopes) void
void
void
setSecretClientCanChange
(boolean theSecretClientCanChange) void
setSecretRequired
(boolean theSecretRequired) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.cdr.api.model.json.IHasAuthorities
addAuthority, addAuthority, addAuthority, hasArgumentsForAuthority, hasAuthority
-
Field Details
-
CLIENTID_PATTERN
- See Also:
-
CLIENT_ID
- See Also:
-
CLIENT_NAME
- See Also:
-
ENABLED
- See Also:
-
PID
- See Also:
-
CLIENT_SECRET_JOINED_DELIMITER
- See Also:
-
-
Constructor Details
-
OAuth2WritableClientDetailsJson
public OAuth2WritableClientDetailsJson()Constructor -
OAuth2WritableClientDetailsJson
-
-
Method Details
-
getJwksUrl
-
setJwksUrl
-
getPublicJwks
-
setPublicJwks
-
getPermissions
Description copied from interface:IHasAuthorities
Returns the authorities that are granted to the user/session- Specified by:
getPermissions
in interfaceIHasAuthorities
-
setPermissions
-
addAllowedGrantType
-
addAllowedGrantType
-
addAutoApproveScopeIfNotBlank
-
addRedirectUrlIfNotBlank
-
addScopeIfNotBlank
-
getAccessTokenValiditySeconds
Description copied from interface:ClientDetails
The access token validity period for this client. Null if not set explicitly (implementations might use that fact to provide a default value for instance).- Specified by:
getAccessTokenValiditySeconds
in interfaceClientDetails
- Returns:
- the access token validity period
-
setAccessTokenValiditySeconds
-
getAdditionalInformation
Description copied from interface:ClientDetails
Additional information for this client, not needed by the vanilla OAuth protocol but might be useful, for example, for storing descriptive information.- Specified by:
getAdditionalInformation
in interfaceClientDetails
- Returns:
- a map of additional information
-
getAllowedGrantTypes
-
setAllowedGrantTypes
-
getAuthorities
This method is a part of the Spring Security framework, and returns an unmodifiable copy of the client authorities. UsegetPermissions()
if you want to modify the actual values.- Specified by:
getAuthorities
in interfaceClientDetails
- Returns:
- the authorities (never
null
)
-
getAuthorizedGrantTypes
Description copied from interface:ClientDetails
The grant types for which this client is authorized.- Specified by:
getAuthorizedGrantTypes
in interfaceClientDetails
- Returns:
- The grant types for which this client is authorized.
-
hasAutoApproveScopes
-
hasAutoGrantScopes
-
getAutoApproveScopes
-
setAutoApproveScopes
-
getAutoGrantScopes
-
setAutoGrantScopes
-
getAutoApproveScopesSpaceSeparated
-
getAutoGrantScopesSpaceSeparated
-
getClientId
Description copied from interface:ClientDetails
The client id.- Specified by:
getClientId
in interfaceClientDetails
- Returns:
- The client id.
-
setClientId
-
getClientName
-
setClientName
-
getClientSecret
Description copied from interface:ClientDetails
The client secret. Ignored if thesecret isn't required
.- Specified by:
getClientSecret
in interfaceClientDetails
- Returns:
- The client secret.
-
getClientSecrets
-
setClientSecrets
-
getPid
-
setPid
-
getRefreshTokenValiditySeconds
Description copied from interface:ClientDetails
The refresh token validity period for this client. Null for default value set by token service, and zero or negative for non-expiring tokens.- Specified by:
getRefreshTokenValiditySeconds
in interfaceClientDetails
- Returns:
- the refresh token validity period
-
setRefreshTokenValiditySeconds
-
getRegisteredRedirectUri
Description copied from interface:ClientDetails
The pre-defined redirect URI for this client to use during the "authorization_code" access grant. See OAuth spec, section 4.1.1.- Specified by:
getRegisteredRedirectUri
in interfaceClientDetails
- Returns:
- The pre-defined redirect URI for this client.
-
getRegisteredRedirectUris
-
setRegisteredRedirectUris
-
setRegisteredRedirectUris
-
getRegisteredRedirectUriOnePerLine
-
getResourceIds
Description copied from interface:ClientDetails
The resources that this client can access. Can be ignored by callers if empty.- Specified by:
getResourceIds
in interfaceClientDetails
- Returns:
- The resources of this client.
-
hasScope
-
getScope
Description copied from interface:ClientDetails
The scope of this client. Empty if the client isn't scoped.- Specified by:
getScope
in interfaceClientDetails
- Returns:
- The scope of this client.
-
setScope
-
getScopes
-
setScopes
-
getScopeSpaceSeparated
-
isAlwaysRequireApproval
-
setAlwaysRequireApproval
-
isAutoApprove
Description copied from interface:ClientDetails
Test whether client needs user approval for a particular scope.- Specified by:
isAutoApprove
in interfaceClientDetails
- Parameters:
theScope
- the scope to consider- Returns:
- true if this client does not need user approval
-
isCanIntrospectAnyTokens
-
setCanIntrospectAnyTokens
-
isCanIntrospectOwnTokens
-
setCanIntrospectOwnTokens
-
isFixedScope
-
setFixedScope
-
isScoped
Description copied from interface:ClientDetails
Whether this client is limited to a specific scope. If false, the scope of the authentication request will be ignored.- Specified by:
isScoped
in interfaceClientDetails
- Returns:
- Whether this client is limited to a specific scope.
-
isSecretRequired
Description copied from interface:ClientDetails
Whether a secret is required to authenticate this client.- Specified by:
isSecretRequired
in interfaceClientDetails
- Returns:
- Whether a secret is required to authenticate this client.
-
setSecretRequired
-
isSecretClientCanChange
-
setSecretClientCanChange
-
isEnabled
-
setEnabled
-
getClientSecret
-
addClientSecret
-
addClientSecret
-
addClientSecret
-
addClientSecret
-
isCanReissueTokens
-
setCanReissueTokens
-
addAutoGrantScopeIfNotBlank
-
addPermission
-
addPermission
-
addPermission
-
removePermission
-
removePermission
-
isRememberApprovedScopes
-
setRememberApprovedScopes
-
isAttestationAccepted
-
setAttestationAccepted
-
getArchivedAt
-
setArchivedAt
-
isCreatedByAppSphere
-
setCreatedByAppSphere
-