Class OpenIdExtension

java.lang.Object
hudson.plugins.openid.OpenIdExtension
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
TeamsExtension, UserInfoExtension

public abstract class OpenIdExtension extends Object implements ExtensionPoint
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
  • Constructor Details

    • OpenIdExtension

      public OpenIdExtension()
  • Method Details

    • isApplicable

      public boolean isApplicable(SecurityRealm realm)
      Allow Extensions to determine that they are applicable when used with specific security realms.
      Parameters:
      realm - the realm.
      Returns:
      true if 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 authRequest using Message.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 MessageExtension implementations from authSuccess and add information to id.

      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 an AuthSuccess instance 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

      public static ExtensionList<OpenIdExtension> 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 request
      IllegalStateException - 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