org.jboss.seam.security.external.openid
Class OpenIdRpBean

java.lang.Object
  extended by org.jboss.seam.security.external.EntityBean
      extended by org.jboss.seam.security.external.openid.OpenIdRpBean
All Implemented Interfaces:
EntityConfigurationApi, OpenIdRelyingPartyApi, OpenIdRelyingPartyConfigurationApi

@Typed(value=OpenIdRpBean.class)
public class OpenIdRpBean
extends EntityBean
implements OpenIdRelyingPartyApi, OpenIdRelyingPartyConfigurationApi

Author:
Marcel Kolsteren

Field Summary
 
Fields inherited from class org.jboss.seam.security.external.EntityBean
hostName, port, protocol
 
Constructor Summary
OpenIdRpBean()
           
 
Method Summary
 OpenIdRequestedAttribute createOpenIdRequestedAttribute(String alias, String typeUri, boolean required, Integer count)
          Creates a request to fetch a certain attribute from the OpenID Provider.
 String getRealm()
          Gets the realm that is used by the relying party.
 String getServiceURL(OpenIdService service)
           
 String getXrdsURL()
          Gets the URL where the XRDS is served that can be used by OpenID providers for relying party discovery.
 void login(String identifier, List<OpenIdRequestedAttribute> attributes, HttpServletResponse response)
          Start an OpenID login dialogue.
 void writeRpXrds(Writer writer)
           
 
Methods inherited from class org.jboss.seam.security.external.EntityBean
createURL, getHostName, getPort, getProtocol, setHostName, setPort, setProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.seam.security.external.api.EntityConfigurationApi
getHostName, getPort, getProtocol, setHostName, setPort, setProtocol
 

Constructor Detail

OpenIdRpBean

public OpenIdRpBean()
Method Detail

login

public void login(String identifier,
                  List<OpenIdRequestedAttribute> attributes,
                  HttpServletResponse response)
Description copied from interface: OpenIdRelyingPartyApi
Start an OpenID login dialogue.

Specified by:
login in interface OpenIdRelyingPartyApi
Parameters:
identifier - either a Claimed Identifier (identifying the user) or an OP Identifier (identifying the OpenID Provider where the user has an account)
attributes - attributes that are requested (they should have different aliases)
response - the HTTP servlet response

getServiceURL

public String getServiceURL(OpenIdService service)

getRealm

public String getRealm()
Description copied from interface: OpenIdRelyingPartyConfigurationApi
Gets the realm that is used by the relying party. A "realm" is a pattern that represents the part of URL-space for which an OpenID Authentication request is valid. See OpenID 2.0 Authentication specification, section 9.2. The OpenID provider uses the realm as the name of the the relying party site that is presented to the end user.

Specified by:
getRealm in interface OpenIdRelyingPartyConfigurationApi
Returns:
the realm

getXrdsURL

public String getXrdsURL()
Description copied from interface: OpenIdRelyingPartyConfigurationApi
Gets the URL where the XRDS is served that can be used by OpenID providers for relying party discovery. The XRDS document served at this URL is described in the OpenID 2.0 Authentication specification, section 13. Remark that some OpenID providers (e.g. Yahoo) require that a Yadis discovery on the realm also results in this document. Meeting this requirement is beyond the responsibility and beyond the reach of the Seam OpenID module, because the realm URL is not "handled" by the web application in which the OpenID module lives. Consult the Seam Security documentation for further details about setting up the realm-based discovery.

Specified by:
getXrdsURL in interface OpenIdRelyingPartyConfigurationApi
Returns:
the URL

writeRpXrds

public void writeRpXrds(Writer writer)

createOpenIdRequestedAttribute

public OpenIdRequestedAttribute createOpenIdRequestedAttribute(String alias,
                                                               String typeUri,
                                                               boolean required,
                                                               Integer count)
Description copied from interface: OpenIdRelyingPartyApi
Creates a request to fetch a certain attribute from the OpenID Provider. The resulting object can be passed to the OpenIdRelyingPartyApi.login(java.lang.String, java.util.List, javax.servlet.http.HttpServletResponse) method.

Specified by:
createOpenIdRequestedAttribute in interface OpenIdRelyingPartyApi
Parameters:
alias - name that identifies this requested attribute
typeUri - attribute type identifier
required - indicates whether the attribute is required
count - indicates the maximum number of values to be returned by the provider; must be at least 1
Returns:
the requested attribute


Copyright © 2011 Seam Framework. All Rights Reserved.