org.openid4java.infocard
Class OpenIDToken

java.lang.Object
  extended by org.openid4java.infocard.OpenIDToken

public class OpenIDToken
extends java.lang.Object

Models the OpenID Infocard token used to transport OpenID messages. An OpenID token encapsulates an OpenID message in key-value form into an element.

Provides functionality for OPs / Servers to create OpenID tokens from OpenID messages, and for RPs / Consumers to parse received tokens into OpenID messages.


Field Summary
private static org.apache.commons.logging.Log _log
           
private  Message _openidMessage
          The encapsulated OpenID Message.
private  OpenIDTokenType _tokenType
          Token type data structure.
private static boolean DEBUG
           
 
Constructor Summary
OpenIDToken(Message openidMessage)
          Constructs an OpenID token encapsulating the provided OpenID Message.
 
Method Summary
static OpenIDToken createFromXmlToken(java.lang.String xmlToken)
          Parses the data posted by the selector into an OpenID token.
 Message getOpenIDMessage()
          Gets the OpenID message contained in the OpenID token.
 ParameterList getOpenIDParams()
          Gets the OpenID message as a ParameterList.
 java.lang.String getToken()
          Generates the XML string representation of the OpenID token.
 OpenIDTokenType getTokenType()
          Gets the OpenID token type.
 void setOpenIDMessage(Message openidMessage)
          Sets the OpenID Message to encapsulate into the token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private static org.apache.commons.logging.Log _log

DEBUG

private static final boolean DEBUG

_tokenType

private OpenIDTokenType _tokenType
Token type data structure.


_openidMessage

private Message _openidMessage
The encapsulated OpenID Message.

Constructor Detail

OpenIDToken

public OpenIDToken(Message openidMessage)
Constructs an OpenID token encapsulating the provided OpenID Message. Should be used on the OP/STS side to generate a RSTR.

Parameters:
openidMessage - The OpenID message obtained from ServerManager.authResponse().
Method Detail

createFromXmlToken

public static OpenIDToken createFromXmlToken(java.lang.String xmlToken)
                                      throws InfocardException
Parses the data posted by the selector into an OpenID token. Should be used on the RP side.

Parameters:
xmlToken - The "xmlToken" parameter posted by the selector.
Returns:
An OpenIDToken encapsulating the OpenID AuthResponse.
Throws:
InfocardException

getOpenIDMessage

public Message getOpenIDMessage()
Gets the OpenID message contained in the OpenID token.


getOpenIDParams

public ParameterList getOpenIDParams()
Gets the OpenID message as a ParameterList.

Returns:
ParameterList containing the OpenID message.

setOpenIDMessage

public void setOpenIDMessage(Message openidMessage)
Sets the OpenID Message to encapsulate into the token.


getTokenType

public OpenIDTokenType getTokenType()
Gets the OpenID token type.

See Also:
OpenIDTokenType

getToken

public java.lang.String getToken()
Generates the XML string representation of the OpenID token.



Copyright 2006-2008 Sxip Identity Corporation