Class SecurityContextHolder
java.lang.Object
com.codename1.backend.security.SecurityContextHolder
Who the calling thread's request is from.
Authentication who = SecurityContextHolder.getContext().getAuthentication();
The context belongs to the thread serving a request, for the length of that
request: the chain that guards the request fills it in, and the server
clears it when the request ends. It does not follow work handed to another
thread -- an @Async method or a scheduled job starts with none.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidForgets the thread's context.static SecurityContextA context with no authentication in it.static SecurityContextThe thread's context; an empty one is made when there is none.static voidsetContext(SecurityContext context) Replaces the thread's context.
-
Method Details
-
getContext
The thread's context; an empty one is made when there is none. -
setContext
Replaces the thread's context. -
clearContext
public static void clearContext()Forgets the thread's context. -
createEmptyContext
A context with no authentication in it.
-