Package hudson.plugins.openid
Class OpenIdExtension
java.lang.Object
hudson.plugins.openid.OpenIdExtension
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
TeamsExtension,UserInfoExtension
An OpenID extension for extending an authentication request and processing an authentication success.
TODO currently there is no mechanism to add general properties to the User or the OpenIdUserProperty
- Author:
- Paul Sandoz
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionList<OpenIdExtension> all()All registered extension points.abstract voidextend(org.openid4java.message.AuthRequest authRequest) Extend the authentication request.voidextendFetch(org.openid4java.message.ax.FetchRequest request) static voidextendRequest(org.openid4java.message.AuthRequest authRequest) Extend the authentication request.protected <T> TgetMessageAs(Class<T> c, org.openid4java.message.AuthSuccess authSuccess, String typeUri) Obtain an extended response message from anAuthSuccessinstance given the class and URI type of the response message.booleanisApplicable(SecurityRealm realm) Allow Extensions to determine that they are applicable when used with specific security realms.abstract voidProcess the authentication success.static voidprocessResponse(org.openid4java.message.AuthSuccess authSuccess, Identity id) Process the authentication success.
-
Constructor Details
-
OpenIdExtension
public OpenIdExtension()
-
-
Method Details
-
isApplicable
Allow Extensions to determine that they are applicable when used with specific security realms.- Parameters:
realm- the realm.- Returns:
trueif this extension is appropriate.- Since:
- 2.2
-
extend
public abstract void extend(org.openid4java.message.AuthRequest authRequest) throws org.openid4java.message.MessageException Extend the authentication request.The implementation may add extensions to
authRequestusingMessage.addExtension(org.openid4java.message.MessageExtension).- Parameters:
authRequest- the authentication request- Throws:
org.openid4java.message.MessageException- if there is a message error extending the request
-
process
public abstract void process(org.openid4java.message.AuthSuccess authSuccess, Identity id) throws org.openid4java.message.MessageException Process the authentication success.The implementation may extract
MessageExtensionimplementations fromauthSuccessand add information toid.- Parameters:
authSuccess- the authentication success.id- the identity.- Throws:
org.openid4java.message.MessageException- if there is a message error processing the success.
-
extendFetch
public void extendFetch(org.openid4java.message.ax.FetchRequest request) throws org.openid4java.message.MessageException - Throws:
org.openid4java.message.MessageException
-
getMessageAs
protected <T> T getMessageAs(Class<T> c, org.openid4java.message.AuthSuccess authSuccess, String typeUri) throws org.openid4java.message.MessageException Obtain an extended response message from anAuthSuccessinstance given the class and URI type of the response message.- Type Parameters:
T- the type of the response message.- Parameters:
c- the class of the response message.authSuccess- the authorization success.typeUri- the URI type of the response message.- Returns:
- the response message, otherwise null if there is not such response message available.
- Throws:
org.openid4java.message.MessageException- if an error obtaining the response message.
-
all
All registered extension points. -
extendRequest
public static void extendRequest(org.openid4java.message.AuthRequest authRequest) throws org.openid4java.message.MessageException Extend the authentication request.All extension points will be iterated through and each one will extend the request.
- Parameters:
authRequest- the authentication request.- Throws:
org.openid4java.message.MessageException- if there is a message error extending the requestIllegalStateException- if there is no Jenkins instance
-
processResponse
public static void processResponse(org.openid4java.message.AuthSuccess authSuccess, Identity id) throws org.openid4java.message.MessageException Process the authentication success.All extension points will be iterated through and each one will process the success.
- Parameters:
authSuccess- the authentication success.id- the identity.- Throws:
org.openid4java.message.MessageException- if there is a message error processing the success.IllegalStateException- if there is no Jenkins instance
-