public interface XSUserInfo
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkLocalScope(String scope)
Deprecated.
can be replaced with
xsuaaToken.hasLocalScope(scope) from
the com.sap.cloud.security.token package. |
boolean |
checkScope(String scope)
Deprecated.
can be replaced with
xsuaaToken.hasScope(scope) from the
com.sap.cloud.security.token package. |
String |
getAdditionalAuthAttribute(String attributeName)
Return additional authentication attributes included by the OAuth client
component.
|
String |
getAppToken()
Deprecated.
Can be replaced with
token.getAccessToken() from the
com.sap.cloud.security.token package. |
String[] |
getAttribute(String attributeName)
Return user attributes.
|
String |
getClientId()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.XSUAA.CLIENT_ID) from
the com.sap.cloud.security.token package. |
String |
getCloneServiceInstanceId()
In case of xsuaa broker plan tokens, it contains the service instance id
Still Supported via
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package. |
String |
getDBToken()
Deprecated.
use
getHdbToken() instead. |
String |
getEmail()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.EMAIL) from the
com.sap.cloud.security.token package. |
String |
getFamilyName()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.FAMILY_NAME) from the
com.sap.cloud.security.token package. Only if it is not
an external attribute. |
String |
getGivenName()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.GIVEN_NAME) from the
com.sap.cloud.security.token package. Only if it is not
an external attribute. |
String |
getGrantType()
Deprecated.
can be replaced with
token.getGrantType() from the
com.sap.cloud.security.token package. This will give you
a GrantType enum entry on which you can call
toString to obtain the grant type as string, e.g.
"client_credentials". |
String |
getHdbToken()
Still Supported via
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package. |
String |
getIdentityZone()
Deprecated.
Have to be replaced with
getZoneId() or
getSubaccountId(). |
String |
getJsonValue(String attribute)
Deprecated.
Can be replaced with
token.getClaimAsString(attribute)
from the com.sap.cloud.security.token package. |
String |
getLogonName()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.USER_NAME) from the
com.sap.cloud.security.token package or with
token.getPrincipal(). |
String |
getOrigin()
Deprecated.
Can be replaced with
token.getClaimAsString(TokenClaims.XSUAA.ORIGIN) from the
com.sap.cloud.security.token package. |
String |
getSubaccountId()
Return subaccount identifier.
|
String |
getSubdomain()
Supported via
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package. |
String[] |
getSystemAttribute(String attributeName)
Still Supported via
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package. |
String |
getToken(String namespace,
String name)
Deprecated.
use
getHdbToken() instead. |
String |
getZoneId()
Deprecated.
Can be replaced with
token.getZoneId() from the
com.sap.cloud.security.token package. |
boolean |
hasAttributes()
Check if the authentication token contains user attributes.
|
boolean |
isInForeignMode()
Check if a token issued for another OAuth client has been forwarded to a
different client,
|
String |
requestToken(XSTokenRequest tokenRequest)
Deprecated.
can be replaced with token flows from the token-client library.
Does not support mtls-based communication to XSUAA identity
provider and will be removed with version 3.0.0.
|
String |
requestTokenForClient(String clientId,
String clientSecret,
String uaaUrl)
Deprecated.
can be replaced with token flows from the token-client library.
Does not support mtls-based communication to XSUAA identity
provider and will be removed with version 3.0.0.
|
String |
requestTokenForUser(String clientId,
String clientSecret,
String uaaUrl)
Deprecated.
can be replaced with token flows from the token-client library.
Does not support mtls-based communication to XSUAA identity
provider and will be removed with version 3.0.0.
|
String getLogonName() throws XSUserInfoException
token.getClaimAsString(TokenClaims.USER_NAME) from the
com.sap.cloud.security.token package or with
token.getPrincipal().XSUserInfoException - if attribute is not available in the authentication tokenString getGivenName() throws XSUserInfoException
token.getClaimAsString(TokenClaims.GIVEN_NAME) from the
com.sap.cloud.security.token package. Only if it is not
an external attribute.XSUserInfoException - if attribute is not available in the authentication tokenString getFamilyName() throws XSUserInfoException
token.getClaimAsString(TokenClaims.FAMILY_NAME) from the
com.sap.cloud.security.token package. Only if it is not
an external attribute.XSUserInfoException - if attribute is not available in the authentication tokenString getOrigin() throws XSUserInfoException
token.getClaimAsString(TokenClaims.XSUAA.ORIGIN) from the
com.sap.cloud.security.token package.XSUserInfoException - if attribute is not available in the authentication token@Deprecated String getIdentityZone() throws XSUserInfoException
getZoneId() or
getSubaccountId().XSUserInfoException - if attribute is not available in the authentication tokenString getSubaccountId() throws XSUserInfoException
getZoneId().XSUserInfoException - if attribute is not available in the authentication tokenString getZoneId() throws XSUserInfoException
token.getZoneId() from the
com.sap.cloud.security.token package.getSubaccountId().XSUserInfoException - if attribute is not available in the authentication tokenString getSubdomain() throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package. Also available on tokens
of type XsuaaToken from java-security.XSUserInfoException - if subdomain is not available in the authentication tokenString getClientId() throws XSUserInfoException
token.getClaimAsString(TokenClaims.XSUAA.CLIENT_ID) from
the com.sap.cloud.security.token package.XSUserInfoException - if attribute is not available in the authentication token@Deprecated String getJsonValue(String attribute) throws XSUserInfoException
token.getClaimAsString(attribute)
from the com.sap.cloud.security.token package.attribute - the name of the JSON propertyXSUserInfoException - if attribute is not available in the authentication tokenString getEmail() throws XSUserInfoException
token.getClaimAsString(TokenClaims.EMAIL) from the
com.sap.cloud.security.token package.XSUserInfoException - if attribute is not available in the authentication token@Deprecated String getDBToken() throws XSUserInfoException
getHdbToken() instead.XSUserInfoException - if db token is not available in the authentication tokenString getHdbToken() throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.XSUserInfoException - if db token is not available in the authentication tokenString getAppToken()
token.getAccessToken() from the
com.sap.cloud.security.token package.@Deprecated String getToken(String namespace, String name) throws XSUserInfoException
getHdbToken() instead.XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.namespace - the namespacename - the nameXSUserInfoException - if token is not available in the authentication tokenString[] getAttribute(String attributeName) throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.attributeName - name of attributeXSUserInfoException - if attribute is not available in the authentication tokenboolean hasAttributes()
throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.XSUserInfoException - if attribute is not available in the authentication tokenString[] getSystemAttribute(String attributeName) throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.attributeName - the name of the system attributeXSUserInfoException - if system attribute is not available in the authentication tokenboolean checkScope(String scope) throws XSUserInfoException
xsuaaToken.hasScope(scope) from the
com.sap.cloud.security.token package.scope - name of fully qualified scopeXSUserInfoException - if attribute is not available in the authentication tokenboolean checkLocalScope(String scope) throws XSUserInfoException
xsuaaToken.hasLocalScope(scope) from
the com.sap.cloud.security.token package.ScopeConverter.scope - name of local scope (the XsuaaScopeConverter omits the
xsappid)XSUserInfoException - if attribute is not available in the authentication tokenString getAdditionalAuthAttribute(String attributeName) throws XSUserInfoException
XSUserInfoAdapterattributeName - name of the authentication attributeXSUserInfoException - if attribute is not available in the authentication tokenString getCloneServiceInstanceId() throws XSUserInfoException
XSUserInfoAdapter from the
com.sap.cloud.security.adapter.xs package.XSUserInfoException - if attribute is not available in the authentication tokenString getGrantType() throws XSUserInfoException
token.getGrantType() from the
com.sap.cloud.security.token package. This will give you
a GrantType enum entry on which you can call
toString to obtain the grant type as string, e.g.
"client_credentials".XSUserInfoException - if attribute is not available in the authentication tokenboolean isInForeignMode()
throws XSUserInfoException
XSUserInfoException - if attribute is not available in the authentication token@Deprecated String requestTokenForClient(String clientId, String clientSecret, String uaaUrl) throws XSUserInfoException
clientId - client idclientSecret - client secretuaaUrl - the uaa urlXSUserInfoException - if an error occurs during token request@Deprecated String requestTokenForUser(String clientId, String clientSecret, String uaaUrl) throws XSUserInfoException
clientId - client idclientSecret - client secretuaaUrl - the uaa urlXSUserInfoException - if an error occurs during token request@Deprecated String requestToken(XSTokenRequest tokenRequest) throws XSUserInfoException
tokenRequest - request dataXSUserInfoException - if an error occurs during token exchangeCopyright © 2021. All rights reserved.