@Contract(threading=STATELESS) public class DefaultUserTokenHandler extends Object implements UserTokenHandler
UserTokenHandler. This class will use
an instance of Principal as a state object for HTTP connections,
if it can be obtained from the given execution context. This helps ensure
persistent connections created with a particular user identity within
a particular security context can be reused by the same user only.
DefaultUserTokenHandler will use the user principal of connection
based authentication schemes such as NTLM or that of the SSL session
with the client authentication turned on. If both are unavailable,
null token will be returned.
| 限定符和类型 | 字段和说明 |
|---|---|
static DefaultUserTokenHandler |
INSTANCE |
| 构造器和说明 |
|---|
DefaultUserTokenHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
getUserToken(HttpRoute route,
HttpContext context)
The token object returned by this method is expected to uniquely
identify the current user if the context is user specific or to be
null if it is not. |
Object |
getUserToken(HttpRoute route,
HttpRequest request,
HttpContext context)
The token object returned by this method is expected to uniquely
identify the current user if the context is user specific or to be
null if it is not. |
public static final DefaultUserTokenHandler INSTANCE
public Object getUserToken(HttpRoute route, HttpContext context)
UserTokenHandlernull if it is not.getUserToken 在接口中 UserTokenHandlerroute - HTTP routecontext - the execution contextnull if the context is not user specific.public Object getUserToken(HttpRoute route, HttpRequest request, HttpContext context)
UserTokenHandlernull if it is not.getUserToken 在接口中 UserTokenHandlerroute - HTTP routerequest - HTTP requestcontext - the execution contextnull if the context is not user specific.Copyright © 2023. All rights reserved.