Class Client
- java.lang.Object
-
- org.apache.cxf.rs.security.oauth2.common.Client
-
- All Implemented Interfaces:
Serializable
@Entity public class Client extends Object implements Serializable
Represents a registered third-party Client application- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Client()Client(String clientId, String clientSecret, boolean isConfidential)Client(String clientId, String clientSecret, boolean isConfidential, String applicationName)Client(String clientId, String clientSecret, boolean isConfidential, String applicationName, String applicationWebUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getAllowedGrantTypes()Get the list of access token grant types this client can use to obtain the access tokens.List<String>getApplicationCertificates()StringgetApplicationDescription()Get the description of the third-party application.StringgetApplicationLogoUri()Get the URI pointing to a logo image of the client applicationStringgetApplicationLogoutUri()StringgetApplicationName()Get the name of the third-party application this client representsStringgetApplicationWebUri()Get the public URI of the third-party application.StringgetClientId()Get the client registration idStringgetClientIpAddress()StringgetClientSecret()Get the client secretStringgetHomeRealm()Map<String,String>getProperties()Get the list of additional client propertiesList<String>getRedirectUris()Get a list of URIs the AuthorizationService may return the authorization code tolonggetRegisteredAt()List<String>getRegisteredAudiences()List<String>getRegisteredScopes()Get the list of registered scopesUserSubjectgetResourceOwnerSubject()Get theUserSubjectrepresenting the resource owner who has registered this clientUserSubjectgetSubject()Get theUserSubjectrepresenting this Client authenticationStringgetTokenEndpointAuthMethod()booleanisConfidential()Get the confidentiality status of this client application.booleanisRegisteredDynamically()voidsetAllowedGrantTypes(List<String> allowedGrantTypes)Set the list of access token grant types this client can use to obtain the access tokens.voidsetApplicationCertificates(List<String> applicationCertificates)voidsetApplicationDescription(String applicationDescription)Set the description of the third-party application.voidsetApplicationLogoUri(String logoPath)Set the URI pointing to a logo image of the client applicationvoidsetApplicationLogoutUri(String applicationLogoutUri)voidsetApplicationName(String applicationName)Set the name of the third-party application this client representsvoidsetApplicationWebUri(String applicationWebUri)Set the public URI of the third-party application.voidsetClientId(String id)voidsetClientIpAddress(String clientIpAddress)voidsetClientSecret(String id)voidsetConfidential(boolean isConf)Set the confidentiality status of this client application.voidsetHomeRealm(String homeRealm)Hint to the authentication system how the users redirected by this client need to be authenticatedvoidsetProperties(Map<String,String> properties)Set the list of additional client propertiesvoidsetRedirectUris(List<String> redirectUris)Sets a list of URIs the AuthorizationService may return the authorization code to.voidsetRegisteredAt(long registeredAt)voidsetRegisteredAudiences(List<String> registeredAudiences)Set the list of registered audiencesvoidsetRegisteredDynamically(boolean registeredDynamically)voidsetRegisteredScopes(List<String> registeredScopes)Set the list of registered scopes.voidsetResourceOwnerSubject(UserSubject resourceOwnerSubject)Set theUserSubjectrepresenting the resource owner who has registered this client.voidsetSubject(UserSubject subject)Set theUserSubjectrepresenting this Client authentication.voidsetTokenEndpointAuthMethod(String tokenEndpointAuthMethod)
-
-
-
Method Detail
-
getClientId
public String getClientId()
Get the client registration id- Returns:
- the consumer key
-
setClientId
public void setClientId(String id)
-
getClientSecret
public String getClientSecret()
Get the client secret- Returns:
- the consumer key
-
setClientSecret
public void setClientSecret(String id)
-
getApplicationName
public String getApplicationName()
Get the name of the third-party application this client represents- Returns:
- the application name
-
setApplicationName
public void setApplicationName(String applicationName)
Set the name of the third-party application this client represents- Parameters:
applicationName- the name
-
getApplicationWebUri
public String getApplicationWebUri()
Get the public URI of the third-party application.- Returns:
- the application URI
-
setApplicationWebUri
public void setApplicationWebUri(String applicationWebUri)
Set the public URI of the third-party application.- Parameters:
applicationWebUri- the application URI
-
getApplicationDescription
public String getApplicationDescription()
Get the description of the third-party application.- Returns:
- the application description
-
setApplicationDescription
public void setApplicationDescription(String applicationDescription)
Set the description of the third-party application.- Parameters:
applicationDescription- the description
-
getApplicationLogoUri
public String getApplicationLogoUri()
Get the URI pointing to a logo image of the client application- Returns:
- the logo URI
-
setApplicationLogoUri
public void setApplicationLogoUri(String logoPath)
Set the URI pointing to a logo image of the client application- Parameters:
logoPath- the logo URI
-
isConfidential
public boolean isConfidential()
Get the confidentiality status of this client application.- Returns:
- the confidentiality status
-
setConfidential
public void setConfidential(boolean isConf)
Set the confidentiality status of this client application. This can be used to restrict which OAuth2 flows this client can participate in.- Parameters:
isConf- true if the client is confidential
-
getRedirectUris
public List<String> getRedirectUris()
Get a list of URIs the AuthorizationService may return the authorization code to- Returns:
- the redirect uris
-
setRedirectUris
public void setRedirectUris(List<String> redirectUris)
Sets a list of URIs the AuthorizationService may return the authorization code to.- Parameters:
redirectUris- the redirect uris
-
getAllowedGrantTypes
public List<String> getAllowedGrantTypes()
Get the list of access token grant types this client can use to obtain the access tokens.- Returns:
- the list of grant types
-
setAllowedGrantTypes
public void setAllowedGrantTypes(List<String> allowedGrantTypes)
Set the list of access token grant types this client can use to obtain the access tokens.- Parameters:
allowedGrantTypes- the list of grant types
-
getSubject
public UserSubject getSubject()
Get theUserSubjectrepresenting this Client authentication- Returns:
- the user subject
-
setSubject
public void setSubject(UserSubject subject)
Set theUserSubjectrepresenting this Client authentication. This property may be set during the registration in cases where a 3rd party client needs to authenticate first before registering as OAuth2 client. This property may also wrap a clientId in cases where a client credentials flow is used- Parameters:
subject- the user subject
-
getResourceOwnerSubject
public UserSubject getResourceOwnerSubject()
Get theUserSubjectrepresenting the resource owner who has registered this client- Returns:
- the resource owner user subject
-
setResourceOwnerSubject
public void setResourceOwnerSubject(UserSubject resourceOwnerSubject)
Set theUserSubjectrepresenting the resource owner who has registered this client. This property may be set in cases where each account (resource) owner registers account specific Clients- Parameters:
resourceOwnerSubject- the resource owner user subject
-
getProperties
public Map<String,String> getProperties()
Get the list of additional client properties- Returns:
- the list of properties
-
setProperties
public void setProperties(Map<String,String> properties)
Set the list of additional client properties- Parameters:
properties- the properties
-
getRegisteredScopes
public List<String> getRegisteredScopes()
Get the list of registered scopes- Returns:
- scopes
-
setRegisteredScopes
public void setRegisteredScopes(List<String> registeredScopes)
Set the list of registered scopes. Registering the scopes will allow the clients not to include the scopes and delegate to the runtime to enforce that the current request scopes are a subset of the pre-registered scopes. Client Registration service is expected to reject unknown scopes.- Parameters:
registeredScopes- the scopes
-
setRegisteredAudiences
public void setRegisteredAudiences(List<String> registeredAudiences)
Set the list of registered audiences- Parameters:
registeredAudiences- audiences
-
setApplicationCertificates
public void setApplicationCertificates(List<String> applicationCertificates)
-
getClientIpAddress
public String getClientIpAddress()
-
setClientIpAddress
public void setClientIpAddress(String clientIpAddress)
-
getRegisteredAt
public long getRegisteredAt()
-
setRegisteredAt
public void setRegisteredAt(long registeredAt)
-
getHomeRealm
public String getHomeRealm()
-
setHomeRealm
public void setHomeRealm(String homeRealm)
Hint to the authentication system how the users redirected by this client need to be authenticated- Parameters:
homeRealm- user home realm
-
isRegisteredDynamically
public boolean isRegisteredDynamically()
-
setRegisteredDynamically
public void setRegisteredDynamically(boolean registeredDynamically)
-
getApplicationLogoutUri
public String getApplicationLogoutUri()
-
setApplicationLogoutUri
public void setApplicationLogoutUri(String applicationLogoutUri)
-
getTokenEndpointAuthMethod
public String getTokenEndpointAuthMethod()
-
setTokenEndpointAuthMethod
public void setTokenEndpointAuthMethod(String tokenEndpointAuthMethod)
-
-