public class SpringSecurityContext extends Object
Token or
AccessToken in context of an application using
spring-security-oauth2.
It uses the SecurityContextHolder to access Spring's
SecurityContext and can therefore used also in context of
asynchronous threads.| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clears the context value from the current thread.
|
static AccessToken |
getAccessToken()
Returns the token using
SecurityContextHolder. |
static Token |
getToken()
Returns the token using
SecurityContextHolder. |
@Nullable public static Token getToken()
SecurityContextHolder.null if SecurityContext is empty or
does not contain a token of this type.@Nullable public static AccessToken getAccessToken()
SecurityContextHolder.null if SecurityContext is empty or
does not contain a token of this type.public static void clear()
Copyright © 2020. All rights reserved.