Package org.genesys.blocks.oauth.model
Class OAuthClient
-
- All Implemented Interfaces:
Serializable,Activatable,Copyable<OAuthClient>,EntityId,org.springframework.data.domain.Persistable<Long>,org.springframework.security.oauth2.provider.ClientDetails
@Entity public class OAuthClient extends AclSid implements org.springframework.security.oauth2.provider.ClientDetails, Copyable<OAuthClient>
OAuth Client information.- Author:
- Matija Obreza
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.genesys.blocks.model.VersionedModel
active
-
Fields inherited from interface org.genesys.blocks.model.Copyable
COPYABLE_FIELDS
-
-
Constructor Summary
Constructors Constructor Description OAuthClient()Instantiates a new o auth client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuthClientapply(OAuthClient source)OAuthClientcopy()Returns null.IntegergetAccessTokenValidity()Gets the access token validity.IntegergetAccessTokenValiditySeconds()Map<String,Object>getAdditionalInformation()Set<String>getAllowedOrigins()Collection<org.springframework.security.core.GrantedAuthority>getAuthorities()Set<String>getAuthorizedGrantTypes()booleangetAutoApprove()Gets the auto approve.protected StringgetAutoApproveScope()Gets the auto approve scope.Set<String>getAutoApproveScopes()Gets the auto approve scopes.StringgetClientId()StringgetClientSecret()StringgetDescription()Gets the description.StringgetFullName()Subclasses should override this method and return a sensible display name for the SID.StringgetGrants()Gets the grants.StringgetOrigins()StringgetPrivateRecaptchaKey()StringgetPublicRecaptchaKey()StringgetRedirect()Gets the redirect.IntegergetRefreshTokenValidity()Gets the refresh token validity.IntegergetRefreshTokenValiditySeconds()Set<String>getRegisteredRedirectUri()StringgetResource()Gets the resource.Set<String>getResourceIds()Collection<OAuthRole>getRoles()Gets the roles.Set<String>getScope()StringgetTitle()Gets the title.booleanisAutoApprove(String scope)booleanisScoped()booleanisSecretRequired()Client secret is required when provided.voidsetAccessTokenValidity(Integer accessTokenValidity)Sets the access token validity.voidsetAdditionalInformation(Map<String,Object> additionalInformation)Sets the additional information.voidsetAllowedOrigins(Set<String> allowedOrigins)voidsetAutoApprove(boolean autoApprove)Sets the auto approve.protected voidsetAutoApproveScope(String autoApproveScope)Sets the auto approve scope.voidsetAutoApproveScopes(Set<String> autoApproveScopes)Sets the auto approve scopes.voidsetClientId(String clientId)Sets the client id.voidsetClientSecret(String clientSecret)Sets the client secret.voidsetDescription(String description)Sets the description.voidsetGrants(String grants)Sets the grants.voidsetGrantTypes(Set<String> grantTypes)Sets the grant types.voidsetOrigins(String origins)voidsetPrivateRecaptchaKey(String privateRecaptchaKey)voidsetPublicRecaptchaKey(String publicRecaptchaKey)voidsetRedirect(String redirect)Sets the redirect.voidsetRedirectUris(Set<String> redirectUris)Sets the redirect uris.voidsetRefreshTokenValidity(Integer refreshTokenValidity)Sets the refresh token validity.voidsetResource(String resource)Sets the resource.voidsetResourceIds(Set<String> resourceIds)Sets the resource ids.voidsetRoles(Set<OAuthRole> roles)Sets the roles.voidsetRuntimeAuthorities(OAuthRole... runtimeAuthorities)voidsetScope(String scope)Sets the scope.voidsetScopes(Set<String> scopes)Sets the scopes.voidsetTitle(String title)Sets the title.-
Methods inherited from class org.genesys.blocks.security.model.AclSid
getAclEntries, getObjectIdentities, getSid, isPrincipal, setAclEntries, setObjectIdentities, setPrincipal, setSid
-
Methods inherited from class org.genesys.blocks.model.AuditedVersionedModel
getCreatedBy, getCreatedDate, getLastModifiedBy, getLastModifiedDate, setCreatedBy, setCreatedDate, setLastModifiedBy, setLastModifiedDate
-
Methods inherited from class org.genesys.blocks.model.VersionedModel
equals, getVersion, hashCode, isActive, setActive, setVersion, toString
-
Methods inherited from class org.genesys.blocks.model.BasicModel
getId, setId
-
Methods inherited from class org.genesys.blocks.model.EmptyModel
isNew
-
-
-
-
Method Detail
-
getClientId
public String getClientId()
- Specified by:
getClientIdin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setClientId
public void setClientId(String clientId)
Sets the client id.- Parameters:
clientId- the new client id
-
getClientSecret
public String getClientSecret()
- Specified by:
getClientSecretin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setClientSecret
public void setClientSecret(String clientSecret)
Sets the client secret.- Parameters:
clientSecret- the new client secret
-
getResource
public String getResource()
Gets the resource.- Returns:
- the resource
-
setResource
public void setResource(String resource)
Sets the resource.- Parameters:
resource- the new resource
-
getGrants
public String getGrants()
Gets the grants.- Returns:
- the grants
-
setGrants
public void setGrants(String grants)
Sets the grants.- Parameters:
grants- the new grants
-
getRedirect
public String getRedirect()
Gets the redirect.- Returns:
- the redirect
-
setRedirect
public void setRedirect(String redirect)
Sets the redirect.- Parameters:
redirect- the new redirect
-
getRoles
public Collection<OAuthRole> getRoles()
Gets the roles.- Returns:
- the roles
-
setRoles
public void setRoles(Set<OAuthRole> roles)
Sets the roles.- Parameters:
roles- the new roles
-
setScope
public void setScope(String scope)
Sets the scope.- Parameters:
scope- the new scope
-
setAutoApprove
public void setAutoApprove(boolean autoApprove)
Sets the auto approve.- Parameters:
autoApprove- the new auto approve
-
getAutoApprove
public boolean getAutoApprove()
Gets the auto approve.- Returns:
- the auto approve
-
getAutoApproveScope
protected String getAutoApproveScope()
Gets the auto approve scope.- Returns:
- the auto approve scope
-
setAutoApproveScope
protected void setAutoApproveScope(String autoApproveScope)
Sets the auto approve scope.- Parameters:
autoApproveScope- the new auto approve scope
-
getAutoApproveScopes
public Set<String> getAutoApproveScopes()
Gets the auto approve scopes.- Returns:
- the auto approve scopes
-
setAutoApproveScopes
public void setAutoApproveScopes(Set<String> autoApproveScopes)
Sets the auto approve scopes.- Parameters:
autoApproveScopes- the new auto approve scopes
-
getResourceIds
public Set<String> getResourceIds()
- Specified by:
getResourceIdsin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setResourceIds
public void setResourceIds(Set<String> resourceIds)
Sets the resource ids.- Parameters:
resourceIds- the new resource ids
-
isSecretRequired
public boolean isSecretRequired()
Client secret is required when provided.- Specified by:
isSecretRequiredin interfaceorg.springframework.security.oauth2.provider.ClientDetails- Returns:
- true, if is secret required
-
isScoped
public boolean isScoped()
- Specified by:
isScopedin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
getScope
public Set<String> getScope()
- Specified by:
getScopein interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setScopes
public void setScopes(Set<String> scopes)
Sets the scopes.- Parameters:
scopes- the new scopes
-
getAuthorizedGrantTypes
public Set<String> getAuthorizedGrantTypes()
- Specified by:
getAuthorizedGrantTypesin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setGrantTypes
public void setGrantTypes(Set<String> grantTypes)
Sets the grant types.- Parameters:
grantTypes- the new grant types
-
getRegisteredRedirectUri
public Set<String> getRegisteredRedirectUri()
- Specified by:
getRegisteredRedirectUriin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setRedirectUris
public void setRedirectUris(Set<String> redirectUris)
Sets the redirect uris.- Parameters:
redirectUris- the new redirect uris
-
getAuthorities
public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
getAccessTokenValiditySeconds
public Integer getAccessTokenValiditySeconds()
- Specified by:
getAccessTokenValiditySecondsin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
getAccessTokenValidity
public Integer getAccessTokenValidity()
Gets the access token validity.- Returns:
- the access token validity
-
setAccessTokenValidity
public void setAccessTokenValidity(Integer accessTokenValidity)
Sets the access token validity.- Parameters:
accessTokenValidity- the new access token validity
-
getRefreshTokenValiditySeconds
public Integer getRefreshTokenValiditySeconds()
- Specified by:
getRefreshTokenValiditySecondsin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
getRefreshTokenValidity
public Integer getRefreshTokenValidity()
Gets the refresh token validity.- Returns:
- the refresh token validity
-
setRefreshTokenValidity
public void setRefreshTokenValidity(Integer refreshTokenValidity)
Sets the refresh token validity.- Parameters:
refreshTokenValidity- the new refresh token validity
-
isAutoApprove
public boolean isAutoApprove(String scope)
- Specified by:
isAutoApprovein interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
getAdditionalInformation
public Map<String,Object> getAdditionalInformation()
- Specified by:
getAdditionalInformationin interfaceorg.springframework.security.oauth2.provider.ClientDetails
-
setAdditionalInformation
public void setAdditionalInformation(Map<String,Object> additionalInformation)
Sets the additional information.- Parameters:
additionalInformation- the additional information
-
setTitle
public void setTitle(String title)
Sets the title.- Parameters:
title- the new title
-
getTitle
public String getTitle()
Gets the title.- Returns:
- the title
-
setDescription
public void setDescription(String description)
Sets the description.- Parameters:
description- the new description
-
getDescription
public String getDescription()
Gets the description.- Returns:
- the description
-
getFullName
public String getFullName()
Description copied from class:AclSidSubclasses should override this method and return a sensible display name for the SID.- Overrides:
getFullNamein classAclSid- Returns:
- SID full name
-
copy
public OAuthClient copy()
Returns null.- Specified by:
copyin interfaceCopyable<OAuthClient>- Returns:
- the o auth client
-
apply
public OAuthClient apply(OAuthClient source)
- Specified by:
applyin interfaceCopyable<OAuthClient>
-
getOrigins
public String getOrigins()
-
setOrigins
public void setOrigins(String origins)
-
getPrivateRecaptchaKey
public String getPrivateRecaptchaKey()
-
setPrivateRecaptchaKey
public void setPrivateRecaptchaKey(String privateRecaptchaKey)
-
getPublicRecaptchaKey
public String getPublicRecaptchaKey()
-
setPublicRecaptchaKey
public void setPublicRecaptchaKey(String publicRecaptchaKey)
-
setRuntimeAuthorities
public void setRuntimeAuthorities(OAuthRole... runtimeAuthorities)
-
-