com.atlassian.crowd.openid.server.provider
Class OpenID4JavaProvider

java.lang.Object
  extended by com.atlassian.crowd.openid.server.provider.OpenID4JavaProvider
All Implemented Interfaces:
CrowdProvider

public class OpenID4JavaProvider
extends Object
implements CrowdProvider


Field Summary
 
Fields inherited from interface com.atlassian.crowd.openid.server.provider.CrowdProvider
OPENID_AUTHENTICATION_REQUEST
 
Constructor Summary
OpenID4JavaProvider()
           
 
Method Summary
 void associate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.openid4java.message.ParameterList requestParameters)
          Creates an association with the RP (client).
 void checkAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.openid4java.message.ParameterList requestParameters)
          Accepts requests for authentication and redirects to authorization page so that users can select which profile to send and whether to accept/deny the request.
 void checkImmediateAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.openid4java.message.ParameterList requestParameters)
          Checks the authentication and immediately sends a response to the relying-party without any internal redirects.
 HttpAuthenticator getHttpAuthenticator()
           
 OpenIDAuthenticationManager getOpenIDAuthenticationManager()
           
 OpenIDPropertyManager getOpenIDPropertyManager()
           
 org.openid4java.server.ServerManager getServerManager()
          The serverManager is part of the openid4java library.
 String getUserInteractionURL()
          The user interaction URL is a relative URL which specified the location the user will be directed to in order to allow/deny the authentication to a relying-party and select which attributes to send (if any).
 void processOpenIDRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void removeOpenIDAuthRequest(javax.servlet.http.HttpSession session)
          Removes the OpenIDAuthRequest from session.
 void sendAuthenticationResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, OpenIDAuthResponse authResp)
          Responds to an authentication request.
protected  void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String destination)
           
protected  void sendRPDirectResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String responseString)
          Sends a direct (HTTP 200) response to the requester.
protected  void sendRPRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String destination)
           
 void setHttpAuthenticator(HttpAuthenticator httpAuthenticator)
           
 void setOpenIDAuthenticationManager(OpenIDAuthenticationManager openIDAuthenticationManager)
           
 void setOpenIDPropertyManager(OpenIDPropertyManager openIDPropertyManager)
           
 void setServerManager(org.openid4java.server.ServerManager serverManager)
          The serverManager is part of the openid4java library.
 void setUserInteractionURL(String userInteractionURL)
          The user interaction URL is a relative URL which specified the location the user will be directed to in order to allow/deny the authentication to a relying-party and select which attributes to send (if any).
 void verifyAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.openid4java.message.ParameterList requestParameters)
          Verifies authentication (used in dumb-mode).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenID4JavaProvider

public OpenID4JavaProvider()
Method Detail

processOpenIDRequest

public void processOpenIDRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws IOException,
                                 OpenIDException
Specified by:
processOpenIDRequest in interface CrowdProvider
Throws:
IOException
OpenIDException

sendRedirect

protected void sendRedirect(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            String destination)
                     throws IOException
Throws:
IOException

sendRPRedirect

protected void sendRPRedirect(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              String destination)
                       throws IOException
Throws:
IOException

sendRPDirectResponse

protected void sendRPDirectResponse(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    String responseString)
                             throws IOException
Sends a direct (HTTP 200) response to the requester.

Parameters:
response - HttpServletResponse to write output to.
responseString - response output to write.
Throws:
IOException - error writing response.

removeOpenIDAuthRequest

protected void removeOpenIDAuthRequest(javax.servlet.http.HttpSession session)
Removes the OpenIDAuthRequest from session. This is used when an error occurs with the processing the request, and the app needs to forget about the old auth request.


associate

public void associate(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      org.openid4java.message.ParameterList requestParameters)
               throws IOException
Creates an association with the RP (client).

Specified by:
associate in interface CrowdProvider
Parameters:
request - HttpServletRequest
response - HttpServletResponse
requestParameters - representation of the request parameters.
Throws:
IOException - error sending response to RP.

checkAuthentication

public void checkAuthentication(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                org.openid4java.message.ParameterList requestParameters)
                         throws IOException,
                                OpenIDException
Accepts requests for authentication and redirects to authorization page so that users can select which profile to send and whether to accept/deny the request.

Specified by:
checkAuthentication in interface CrowdProvider
Parameters:
request - HttpServletRequest
response - HttpServletResponse
requestParameters - representation of the request parameters
Throws:
IOException - error redirecting to Allow Authentication screen
OpenIDException - error when trying to translate request parameters into an valid OpenID authentication request

checkImmediateAuthentication

public void checkImmediateAuthentication(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         org.openid4java.message.ParameterList requestParameters)
                                  throws IOException,
                                         OpenIDException
Checks the authentication and immediately sends a response to the relying-party without any internal redirects. For the checkImmediate to respond with a successful response: 1. a user must be logged in 2. the authentication request must be valid (as defined in OpenIDAuthenticationManager.validateRequest()). 3. the user must have a pre-existing trust relationship with the site (as defined in OpenIDAuthenticationManager.checkImmediate). Otherwise, an unsuccessful response is generated.

Specified by:
checkImmediateAuthentication in interface CrowdProvider
Throws:
IOException
OpenIDException

sendAuthenticationResponse

public void sendAuthenticationResponse(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       OpenIDAuthResponse authResp)
                                throws IOException
Responds to an authentication request. The authentication request to respond to must be in session.

Specified by:
sendAuthenticationResponse in interface CrowdProvider
Throws:
IOException

verifyAuthentication

public void verifyAuthentication(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 org.openid4java.message.ParameterList requestParameters)
                          throws IOException
Verifies authentication (used in dumb-mode).

Specified by:
verifyAuthentication in interface CrowdProvider
Parameters:
request - HttpServletRequest
response - HttpServletResponse
requestParameters - representation of the request parameters.
Throws:
IOException - error while sending a direct response to the user.

getServerManager

public org.openid4java.server.ServerManager getServerManager()
The serverManager is part of the openid4java library.

Returns:
injected serverManager.

setServerManager

public void setServerManager(org.openid4java.server.ServerManager serverManager)
The serverManager is part of the openid4java library.

Parameters:
serverManager - serverManager to inject.

getUserInteractionURL

public String getUserInteractionURL()
The user interaction URL is a relative URL which specified the location the user will be directed to in order to allow/deny the authentication to a relying-party and select which attributes to send (if any).

Returns:
spring injected userInteractionURL.

setUserInteractionURL

public void setUserInteractionURL(String userInteractionURL)
The user interaction URL is a relative URL which specified the location the user will be directed to in order to allow/deny the authentication to a relying-party and select which attributes to send (if any).

Parameters:
userInteractionURL - userInteractionURL to inject.

getOpenIDAuthenticationManager

public OpenIDAuthenticationManager getOpenIDAuthenticationManager()

setOpenIDAuthenticationManager

public void setOpenIDAuthenticationManager(OpenIDAuthenticationManager openIDAuthenticationManager)

getOpenIDPropertyManager

public OpenIDPropertyManager getOpenIDPropertyManager()

setOpenIDPropertyManager

public void setOpenIDPropertyManager(OpenIDPropertyManager openIDPropertyManager)

getHttpAuthenticator

public HttpAuthenticator getHttpAuthenticator()

setHttpAuthenticator

public void setHttpAuthenticator(HttpAuthenticator httpAuthenticator)


Copyright © 2012 Atlassian. All Rights Reserved.