Package com.sap.cloud.security.token
Class SecurityContext
java.lang.Object
com.sap.cloud.security.token.SecurityContext
Thread wide
Token storage.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the current token and certificate from thread wide storage.static voidClears the current Token from thread wide storage.static AccessTokenReturns the token that is saved in thread wide storage.static CertificateReturns the certificate that is saved in thread wide storage.static TokengetToken()Returns the token that is saved in thread wide storage.static voidsetClientCertificate(Certificate certificate) Saves the certificate thread wide.static voidSaves the validated (!) token thread wide.
-
Method Details
-
getClientCertificate
Returns the certificate that is saved in thread wide storage.- Returns:
- the certificate or null if the storage is empty.
-
setClientCertificate
Saves the certificate thread wide.- Parameters:
certificate- certificate to be saved.
-
setToken
Saves the validated (!) token thread wide.- Parameters:
token- token to be saved.
-
getToken
Returns the token that is saved in thread wide storage.- Returns:
- the token or null if the storage is empty.
-
getAccessToken
Returns the token that is saved in thread wide storage.- Returns:
- the token or null if the storage is empty or the token does not
implement the
AccessTokeninterface.
-
clearToken
public static void clearToken()Clears the current Token from thread wide storage. -
clear
public static void clear()Clears the current token and certificate from thread wide storage.
-