public class AuthModuleOne extends Object implements AsyncServerAuthModule
validateRequest(MessageInfoContext, Subject, Subject)
and secureResponse(MessageInfoContext, Subject)
methods return values can be decided
based on the value of two request headers.Modifier and Type | Field and Description |
---|---|
static String |
AUTH_MODULE_ONE_CONTEXT_ENTRY
Context entry set by this auth module.
|
static String |
AUTH_MODULE_ONE_PRINCIPAL
Principal name set by this auth module.
|
static String |
AUTH_MODULE_ONE_SECURE_RESPONSE_HEADER_NAME
The request header for deciding the return value from
secureResponse(MessageInfoContext, Subject) . |
static String |
AUTH_MODULE_ONE_VALIDATE_REQUEST_HEADER_NAME
The request header for deciding the return value from
validateRequest(MessageInfoContext, Subject, Subject) . |
Constructor and Description |
---|
AuthModuleOne() |
Modifier and Type | Method and Description |
---|---|
Promise<Void,AuthenticationException> |
cleanSubject(MessageInfoContext messageInfo,
Subject clientSubject)
Does nothing.
|
String |
getModuleId()
Returns the class's short name.
|
Collection<Class<?>> |
getSupportedMessageTypes()
Returns the
Request and Response classes. |
Promise<Void,AuthenticationException> |
initialize(javax.security.auth.message.MessagePolicy requestPolicy,
javax.security.auth.message.MessagePolicy responsePolicy,
CallbackHandler callbackHandler,
Map config)
Does nothing.
|
Promise<javax.security.auth.message.AuthStatus,AuthenticationException> |
secureResponse(MessageInfoContext messageInfo,
Subject serviceSubject)
Return value is based on the presents and value of the
X-JASPI-AUTH-MODULE-ONE-SECURE-RESPONSE request
header. |
Promise<javax.security.auth.message.AuthStatus,AuthenticationException> |
validateRequest(MessageInfoContext messageInfo,
Subject clientSubject,
Subject serviceSubject)
Return value is based on the presents and value of the
X-JASPI-AUTH-MODULE-ONE-VALIDATE-REQUEST request
header. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final String AUTH_MODULE_ONE_VALIDATE_REQUEST_HEADER_NAME
validateRequest(MessageInfoContext, Subject, Subject)
.public static final String AUTH_MODULE_ONE_SECURE_RESPONSE_HEADER_NAME
secureResponse(MessageInfoContext, Subject)
.public static final String AUTH_MODULE_ONE_PRINCIPAL
public static final String AUTH_MODULE_ONE_CONTEXT_ENTRY
public String getModuleId()
getModuleId
in interface AsyncServerAuthModule
public Promise<Void,AuthenticationException> initialize(javax.security.auth.message.MessagePolicy requestPolicy, javax.security.auth.message.MessagePolicy responsePolicy, CallbackHandler callbackHandler, Map config)
initialize
in interface AsyncServerAuthModule
requestPolicy
- The request policy this module must enforce, or null
.responsePolicy
- The response policy this module must enforce, or null
.callbackHandler
- CallbackHandler
used to request information.config
- A Map
of module-specific configuration properties.Promise
that will be completed, as some point in the future, with
either a successful value or a failure value. A successfully completed Promise
will
contain no value and a failed completed Promise
will contain an
AuthenticationException
if module initialization fails, including for the case
where the options argument contains elements that are not supported by the module.public Collection<Class<?>> getSupportedMessageTypes()
Request
and Response
classes.getSupportedMessageTypes
in interface AsyncServerAuthModule
Collection
of Class
objects, with at least on element defining the
message type(s) supported by the module.public Promise<javax.security.auth.message.AuthStatus,AuthenticationException> validateRequest(MessageInfoContext messageInfo, Subject clientSubject, Subject serviceSubject)
X-JASPI-AUTH-MODULE-ONE-VALIDATE-REQUEST
request
header.validateRequest
in interface AsyncServerAuthModule
messageInfo
- The message context info for this request.clientSubject
- A Subject
that represents the subject of this request.serviceSubject
- A Subject
that represents the subject for the server or
null
. It may be used to secure the message response.A Promise
that will be completed, as some point in the future, with
either a successful value or a failure value.
A successfully completed Promise
will contain an AuthStatus
representing
the completion status of the message processing. See
ServerAuth.validateRequest(
javax.security.auth.message.MessageInfo, Subject, Subject)
for the allowed
AuthStatus
values.
A failed completed Promise
will contain an AuthenticationException
when
the message processing failed without establishing a failure response message in the
MessageContextInfo
.
AuthStatus
,
ServerAuth.validateRequest(
javax.security.auth.message.MessageInfo, Subject, Subject)
public Promise<javax.security.auth.message.AuthStatus,AuthenticationException> secureResponse(MessageInfoContext messageInfo, Subject serviceSubject)
X-JASPI-AUTH-MODULE-ONE-SECURE-RESPONSE
request
header.secureResponse
in interface AsyncServerAuthModule
messageInfo
- The message context info for this request.serviceSubject
- A Subject
that represents the subject for the server or
null
. It may be used to secure the message response.A Promise
that will be completed, as some point in the future, with
either a successful value or a failure value.
A successfully completed Promise
will contain an AuthStatus
representing
the completion status of the processing. See
ServerAuth.secureResponse(
javax.security.auth.message.MessageInfo, Subject)
for the allowed
AuthStatus
values. Note AuthStatus.SEND_CONTINUE
is not supported by this
interface
A failed completed Promise
will contain an AuthenticationException
when
the message processing failed without establishing a failure response message in the
MessageContextInfo
.
AuthStatus
,
ServerAuth.secureResponse(
javax.security.auth.message.MessageInfo, Subject)
public Promise<Void,AuthenticationException> cleanSubject(MessageInfoContext messageInfo, Subject clientSubject)
cleanSubject
in interface AsyncServerAuthModule
messageInfo
- The message context info for this request.clientSubject
- A Subject
that represents the subject of this request.Promise
that will be completed, as some point in the future, with
either a successful value or a failure value. A successfully completed Promise
will
contain no value and a failed completed Promise
will contain an
AuthenticationException
if an error occurs during the Subject
processing.ServerAuth.cleanSubject(
javax.security.auth.message.MessageInfo, Subject)
Copyright © 2025 Open Identity Platform Community. All rights reserved.