com.atlassian.crowd.openid.client.consumer
Class OpenID4JavaConsumer

java.lang.Object
  extended by com.atlassian.crowd.openid.client.consumer.OpenID4JavaConsumer
All Implemented Interfaces:
CrowdConsumer

public class OpenID4JavaConsumer
extends java.lang.Object
implements CrowdConsumer

OpenID4JavaConsumer is an implementation of CrowdConsumer, which uses the openid4java library to implement the OpenID protocol.


Field Summary
 
Fields inherited from interface com.atlassian.crowd.openid.client.consumer.CrowdConsumer
OPENID_AUTH_REQUEST, OPENID_AUTH_RESPONSE, OPENID_RETURN_TO_URL
 
Constructor Summary
OpenID4JavaConsumer()
           
 
Method Summary
 void authenticateRequest(OpenIDAuthRequest openidReq, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Make authentication request to the OpenID Provider.
 org.openid4java.consumer.ConsumerManager getConsumerManager()
          The consumerManager is part of the openid4java library.
 void setConsumerManager(org.openid4java.consumer.ConsumerManager consumerManager)
          The consumerManager is part of the openid4java library.
 OpenIDAuthResponse verifyResponse(javax.servlet.http.HttpServletRequest request)
          Verifies an authentication response from the OpenID Provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenID4JavaConsumer

public OpenID4JavaConsumer()
Method Detail

authenticateRequest

public void authenticateRequest(OpenIDAuthRequest openidReq,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws OpenIDAuthRequestException
Make authentication request to the OpenID Provider. This follows the OpenID protocol:
  1. Normalise the supplied OpenID identifier (URI/XRI)
  2. Perform discovery (find resultant XRDS or HTML file)
  3. Create association with OP if possible (shared secret)
  4. Redirect to request authentication from OpenID Provider.
Refer to OpenID specifications for more information regarding each of the individual steps. Ultimately, the control is given to the OpenID Provider.

Specified by:
authenticateRequest in interface CrowdConsumer
Parameters:
openidReq - contains all OpenID request data.
request - HttpServletRequest object.
response - HttpServletResponse object.
Throws:
OpenIDAuthRequestException - if an error occurs while making the request.

verifyResponse

public OpenIDAuthResponse verifyResponse(javax.servlet.http.HttpServletRequest request)
Verifies an authentication response from the OpenID Provider. The basic verification process is delegated to the openid4java library which verifies the nonce, signatures and discovery information. See the OpenID protocol specifications for more information.

Specified by:
verifyResponse in interface CrowdConsumer
Parameters:
request - HttpServletRequest object.
Returns:
response object containing principal details or an error message.

getConsumerManager

public org.openid4java.consumer.ConsumerManager getConsumerManager()
The consumerManager is part of the openid4java library.

Returns:
injected consumerManager.

setConsumerManager

public void setConsumerManager(org.openid4java.consumer.ConsumerManager consumerManager)
The consumerManager is part of the openid4java library.

Parameters:
consumerManager - to inject.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.