public abstract class AbstractServerAuthModule extends Object implements ServerAuthModule
The ServerAuthModule can delegate to a login module passed via the module option "login-module-delegate"
Modifier and Type | Field and Description |
---|---|
protected CallbackHandler |
callbackHandler
Call back handler
|
protected Map |
options |
protected MessagePolicy |
requestPolicy |
protected MessagePolicy |
responsePolicy |
protected ArrayList<Class> |
supportedTypes |
Constructor and Description |
---|
AbstractServerAuthModule() |
Modifier and Type | Method and Description |
---|---|
void |
cleanSubject(MessageInfo messageInfo,
Subject subject)
Remove method specific principals and credentials from the subject.
|
CallbackHandler |
getCallbackHandler() |
Class[] |
getSupportedMessageTypes()
Get the one or more Class objects representing the message
types supported by the module.
|
void |
initialize(MessagePolicy requestPolicy,
MessagePolicy responsePolicy,
CallbackHandler handler,
Map options)
Initialize this module with request and response message policies to
enforce, a CallbackHandler, and any module-specific configuration
properties.
|
void |
setCallbackHandler(CallbackHandler callbackHandler) |
protected abstract boolean |
validate(Subject clientSubject,
MessageInfo messageInfo)
Subclasses have to implement this method to actually validate the subject
|
AuthStatus |
validateRequest(MessageInfo messageInfo,
Subject clientSubject,
Subject serviceSubject)
This method delegates to a login module if configured in the module options.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
secureResponse
protected CallbackHandler callbackHandler
protected MessagePolicy requestPolicy
protected MessagePolicy responsePolicy
protected Map options
public void initialize(MessagePolicy requestPolicy, MessagePolicy responsePolicy, CallbackHandler handler, Map options) throws AuthException
ServerAuthModule
Initialize this module with request and response message policies to enforce, a CallbackHandler, and any module-specific configuration properties.
The request policy and the response policy must not both be null.
initialize
in interface ServerAuthModule
requestPolicy
- The request policy this module must enforce, or null.responsePolicy
- The response policy this module must enforce, or null.handler
- CallbackHandler used to request information.options
- A Map of module-specific configuration properties.AuthException
- - If module initialization fails, including for the case
where the options argument contains elements that are
not supported by the module.ServerAuthModule.initialize(javax.security.auth.message.MessagePolicy, javax.security.auth.message.MessagePolicy, javax.security.auth.callback.CallbackHandler, java.util.Map)
public void cleanSubject(MessageInfo messageInfo, Subject subject) throws AuthException
ServerAuth
Remove method specific principals and credentials from the subject.
cleanSubject
in interface ServerAuth
messageInfo
- - A contextual object that encapsulates the client request
and server response objects, and that may be used to save
state across a sequence of calls made to the methods of
this interface for the purpose of completing a secure
message exchange.subject
- - The Subject instance from which the Principals and credentials
are to be removed.AuthException
- if an error occurs during the Subject processing.public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException
validateRequest
in interface ServerAuth
messageInfo
- - A contextual object that encapsulates the client
request and server response objects, and that may be
used to save state across a sequence of calls made to
the methods of this interface for the purpose of
completing a secure message exchange.clientSubject
- - A Subject that represents the source of the service request. It is used by the
method implementation to store Principals and credentials validated in the request.serviceSubject
- - A Subject that represents the recipient of the service request, or null. It may be
used by the method implementation as the source of Principals or credentials to be used to validate the
request. If the Subject is not null, the method implementation may add additional Principals or
credentials (pertaining to the recipient of the service request) to the Subject.AuthException
- When the message processing failed without establishing a failure response
message (in messageInfo).public Class[] getSupportedMessageTypes()
ServerAuthModule
Get the one or more Class objects representing the message types supported by the module.
getSupportedMessageTypes
in interface ServerAuthModule
ServerAuthModule.getSupportedMessageTypes()
public CallbackHandler getCallbackHandler()
public void setCallbackHandler(CallbackHandler callbackHandler)
protected abstract boolean validate(Subject clientSubject, MessageInfo messageInfo) throws AuthException
AuthException
Copyright © 2017 JBoss by Red Hat. All rights reserved.