hudson.plugins.openid
Class OpenIdExtension

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

public abstract class OpenIdExtension
extends java.lang.Object
implements hudson.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

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
OpenIdExtension()
           
 
Method Summary
static hudson.ExtensionList<OpenIdExtension> all()
          All registered extension points.
abstract  void extend(org.openid4java.message.AuthRequest authRequest)
          Extend the authentication request.
static void extendRequest(org.openid4java.message.AuthRequest authRequest)
          Extend the authentication request.
protected
<T> T
getMessageAs(java.lang.Class<T> c, org.openid4java.message.AuthSuccess authSuccess, java.lang.String typeUri)
          Obtain an extended response message from an AuthSuccess instance given the class and URI type of the response message.
abstract  void process(org.openid4java.message.AuthSuccess authSuccess, Identity id)
          Process the authentication success.
static void processResponse(org.openid4java.message.AuthSuccess authSuccess, Identity id)
          Process the authentication success.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenIdExtension

public OpenIdExtension()
Method Detail

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.

getMessageAs

protected <T> T getMessageAs(java.lang.Class<T> c,
                             org.openid4java.message.AuthSuccess authSuccess,
                             java.lang.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 hudson.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

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.


Copyright © 2004-2011. All Rights Reserved.