com.filenet.api.authentication
Class OpenTokenCredentials
- java.lang.Object
-
- com.filenet.api.authentication.Credentials
-
- com.filenet.api.authentication.OpenTokenCredentials
-
public class OpenTokenCredentials extends Credentials
This class is a type ofCredentialsobject which holds authentication materials consisting of an OAuth or OIDC token.The calling application is responsible for obtaining an OAuth or OIDC token representing the authenticated user in any manner it chooses. For example, the client may obtain it by integrating their application with an OAuth/OIDC Identity Provider (IdP). Or the token may be propagated to the caller from another service. The application can even use the OAuth Resource Owner Password Credentials (ROPC) grant to obtain it from an OAuth server using username/password credentials.
This class may only be used with the WSI transport, and in that case removes the requirement to perform a JAAS login.
- Since:
- Version 5.5.9.
-
-
Constructor Summary
Constructors Constructor and Description OpenTokenCredentials(java.lang.String userName, java.lang.String token, java.lang.String realm)Constructs an instance holding a specified token plus additional parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object other)java.lang.StringgetRealm()Returns the realm held by this object, if any.java.lang.StringgetToken()Returns the OAuth or OIDC token held by this object.java.lang.StringgetUsername()Returns the username held by this object.inthashCode()java.lang.StringtoString()-
Methods inherited from class com.filenet.api.authentication.Credentials
doAs, getCurrent
-
-
-
-
Constructor Detail
-
OpenTokenCredentials
public OpenTokenCredentials(java.lang.String userName, java.lang.String token, java.lang.String realm)Constructs an instance holding a specified token plus additional parameters.- Parameters:
userName- The name of the user authenticated by the token.token- The OAuth or OIDC token.realm- Optional realm if the CPE server can accept requests from multiple IdPs. If provided, should match an authentication filter for the auth-token-realm HTTP header in the CPE openidConnectClient WebSphere configuration, when multiple IdPs are configured.
-
-
Method Detail
-
getUsername
public java.lang.String getUsername()
Returns the username held by this object.- Returns:
- The username.
-
getToken
public java.lang.String getToken()
Returns the OAuth or OIDC token held by this object.- Returns:
- The token.
-
getRealm
public java.lang.String getRealm()
Returns the realm held by this object, if any.- Returns:
- The realm or null.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-