@Beta public class SecurityContextThreadContextListener extends Object implements ThreadContextListener
ThreadContextListener
implementation reading the Basic Authentication Header from the incoming request and
storing it in the current ThreadContext
.ThreadContextListener.DefaultPriorities
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_SECURITY_CONTEXT_TOKEN
The key of the stored BasicCredentials in the current
ThreadContext . |
Constructor and Description |
---|
SecurityContextThreadContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterInitialize(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked after the current
ThreadContext is initialized and set. |
void |
beforeDestroy(ThreadContext threadContext,
ThreadContext parentThreadContext)
Invoked before the current
ThreadContext is destroyed and reset. |
int |
getPriority()
Returns the priority that defines the order in which listeners are invoked.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterDestroy, beforeInitialize, compareTo
public static final String PROPERTY_SECURITY_CONTEXT_TOKEN
ThreadContext
.public SecurityContextThreadContextListener()
public void afterInitialize(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContextListener
ThreadContext
is initialized and set.afterInitialize
in interface ThreadContextListener
threadContext
- The ThreadContext
that was initialized is now set.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.public void beforeDestroy(@Nonnull ThreadContext threadContext, @Nullable ThreadContext parentThreadContext)
ThreadContextListener
ThreadContext
is destroyed and reset.beforeDestroy
in interface ThreadContextListener
threadContext
- The ThreadContext
that is destroyed and will be removed.parentThreadContext
- The parent ThreadContext
, or null
if there is no parent ThreadContext
.public int getPriority()
ThreadContextListener
getPriority
in interface ThreadContextListener
Copyright © 2021 SAP SE. All rights reserved.