public class OpenIdConnectModule extends Object implements AsyncServerAuthModule
Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_TIMEOUT_KEY
Lookup key for the configured HTTP connection's connection timeout for this module.
|
static String |
HEADER_KEY
Lookup key for the configured HTTP header used by this module to locate JWSs.
|
static String |
READ_TIMEOUT_KEY
Lookup key for the configured HTTP connection's read timeout for this module.
|
static String |
RESOLVERS_KEY
Lookup key for the configured resolvers which will be used by this module.
|
Constructor and Description |
---|
OpenIdConnectModule()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Promise<Void,AuthenticationException> |
cleanSubject(MessageInfoContext messageInfo,
Subject subject)
Nothing to clean.
|
String |
getModuleId()
Gets the ID of the module to be used in creating authentication audit logs to uniquely
identify the authentication module and its outcome when processing a request message.
|
Collection<Class<?>> |
getSupportedMessageTypes()
Gets the
Collection of Class objects of the message types supported by the
module. |
void |
initialize(javax.security.auth.message.MessagePolicy requestPolicy,
javax.security.auth.message.MessagePolicy responsePolicy,
CallbackHandler callbackHandler,
Map<String,Object> config)
Initialize this module with request and response message policies to enforce, a
CallbackHandler , and any module specific configuration properties. |
Promise<javax.security.auth.message.AuthStatus,AuthenticationException> |
secureResponse(MessageInfoContext messageInfo,
Subject subject)
Sends SEND_SUCCESS automatically.
|
Promise<javax.security.auth.message.AuthStatus,AuthenticationException> |
validateRequest(MessageInfoContext messageInfo,
Subject clientSubject,
Subject serviceSubject)
Attempts to retrieve the value of the specified OpenID Connect header from the messageInfo, then
converts this to a Jwt and attempts to decrypt.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final String READ_TIMEOUT_KEY
public static final String CONNECTION_TIMEOUT_KEY
public static final String HEADER_KEY
public static final String RESOLVERS_KEY
public String getModuleId()
AsyncServerAuthModule
getModuleId
in interface AsyncServerAuthModule
public void initialize(javax.security.auth.message.MessagePolicy requestPolicy, javax.security.auth.message.MessagePolicy responsePolicy, CallbackHandler callbackHandler, Map<String,Object> config) throws AuthenticationException
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 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.AuthenticationException
- when module initialization fails, including for the case
where the options argument contains elements that are not supported by the module.public Promise<javax.security.auth.message.AuthStatus,AuthenticationException> validateRequest(MessageInfoContext messageInfo, Subject clientSubject, Subject serviceSubject)
OpenIdResolver
interface
to ensure that we are the intended audience, the token has not expired and the issuer was an expected source.
If all of these validate, we return SUCCESS, otherwise SEND_FAILURE.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.AuthStatus
,
ServerAuth.validateRequest(
javax.security.auth.message.MessageInfo, Subject, Subject)
public Promise<javax.security.auth.message.AuthStatus,AuthenticationException> secureResponse(MessageInfoContext messageInfo, Subject subject)
secureResponse
in interface AsyncServerAuthModule
messageInfo
- The message context info for this request.subject
- 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 subject)
cleanSubject
in interface AsyncServerAuthModule
messageInfo
- The message context info for this request.subject
- 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)
public Collection<Class<?>> getSupportedMessageTypes()
Collection
of Class
objects of the message types supported by the
module.getSupportedMessageTypes
in interface AsyncServerAuthModule
Collection
of Class
objects, with at least on element defining the
message type(s) supported by the module.Copyright © 2010-2018, ForgeRock All Rights Reserved.