PicketLink Federation Core 2.1.6.Final-redhat-2

org.picketlink.identity.federation.core.wstrust
Class WSTrustRequestContext

java.lang.Object
  extended by org.picketlink.identity.federation.core.wstrust.WSTrustRequestContext
All Implemented Interfaces:
ProtocolContext

public class WSTrustRequestContext
extends Object
implements ProtocolContext

The WSTrustRequestContext contains all the information that is relevant for the security token request processing. Its attributes are divided into two groups: attributes set by the request handler before calling a token provider, and attributes set by the token provider after processing the token request.

Author:
Stefan Guilhen

Constructor Summary
WSTrustRequestContext(RequestSecurityToken request, Principal callerPrincipal)
           Creates an instance of WSTrustRequestContext using the specified request.
 
Method Summary
 String family()
          What family the context belongs to..
 RequestedReferenceType getAttachedReference()
           Obtains the security token attached reference.
 Principal getCallerPrincipal()
           Obtains the principal of the WS-Trust token requester.
 Map<String,Object> getClaimedAttributes()
           Gets the Map that contains the attributes claimed by the caller.
 Principal getOnBehalfOfPrincipal()
           Obtains the principal on behalf of which the WS-Trust request was made.
 KeyInfoType getProofTokenInfo()
           Obtains the KeyInfoType that contains the proof-of-possession token.
 QName getQName()
          Return the QName of the token
 RequestSecurityToken getRequestSecurityToken()
           Obtains the object the contains the information about the security token request.
 SecurityToken getSecurityToken()
           Obtains the security token set by the token provider.
 PublicKey getServiceProviderPublicKey()
           Obtains the PublicKey of the service provider that requires a security token.
 StatusType getStatus()
           Obtains the status of the security token validation.
 String getTokenIssuer()
           Obtains the name of the token issuer (security token service name).
 RequestedReferenceType getUnattachedReference()
           Obtains the security token unattached reference.
 String serviceName()
          An optional service name
 void setAttachedReference(RequestedReferenceType attachedReference)
           Sets the security token attached reference.
 void setClaimedAttributes(Map<String,Object> attributes)
           Sets the caller's attributes.
 void setOnBehalfOfPrincipal(Principal onBehalfOfPrincipal)
           Sets the principal on behalf of which the request was made.
 void setProofTokenInfo(KeyInfoType proofTokenInfo)
           Sets the KeyInfoType that contains the proof-of-possession token.
 void setQName(QName qname)
           
 void setSecurityToken(SecurityToken token)
           Sets the security token in the context.
 void setServiceProviderPublicKey(PublicKey providerPublicKey)
           Sets the PublicKey of the service provider that requires a security token.
 void setStatus(StatusType status)
           Sets the status of the security token validation.
 void setTokenIssuer(String tokenIssuer)
           Sets the name of the token issuer.
 void setTokenType(String tokenType)
           
 void setUnattachedReference(RequestedReferenceType unattachedReference)
           Sets the security token unattached reference.
 String tokenType()
          A String that represents the token type
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WSTrustRequestContext

public WSTrustRequestContext(RequestSecurityToken request,
                             Principal callerPrincipal)

Creates an instance of WSTrustRequestContext using the specified request.

Parameters:
request - a RequestSecurityToken object that contains the information about the security token request.
callerPrincipal - the Principal of the security token requester.
Method Detail

getTokenIssuer

public String getTokenIssuer()

Obtains the name of the token issuer (security token service name).

Returns:
a String representing the token issuer name.

setTokenIssuer

public void setTokenIssuer(String tokenIssuer)

Sets the name of the token issuer.

Parameters:
tokenIssuer - a String representing the token issuer name.

getServiceProviderPublicKey

public PublicKey getServiceProviderPublicKey()

Obtains the PublicKey of the service provider that requires a security token.

Returns:
the service provider's PublicKey.

setServiceProviderPublicKey

public void setServiceProviderPublicKey(PublicKey providerPublicKey)

Sets the PublicKey of the service provider that requires a security token.

Parameters:
providerPublicKey - the service provider's PublicKey.

getOnBehalfOfPrincipal

public Principal getOnBehalfOfPrincipal()

Obtains the principal on behalf of which the WS-Trust request was made.

Returns:
a Principal instance.

setOnBehalfOfPrincipal

public void setOnBehalfOfPrincipal(Principal onBehalfOfPrincipal)

Sets the principal on behalf of which the request was made.

Parameters:
onBehalfOfPrincipal - a Principal instance.

getCallerPrincipal

public Principal getCallerPrincipal()

Obtains the principal of the WS-Trust token requester.

Returns:
a reference to the caller Principal object.

getRequestSecurityToken

public RequestSecurityToken getRequestSecurityToken()

Obtains the object the contains the information about the security token request.

Returns:
a reference to the RequestSecurityToken instance.

getProofTokenInfo

public KeyInfoType getProofTokenInfo()

Obtains the KeyInfoType that contains the proof-of-possession token.

Returns:
a reference to the KeyInfoType that wraps the proof-of-possession token.

setProofTokenInfo

public void setProofTokenInfo(KeyInfoType proofTokenInfo)

Sets the KeyInfoType that contains the proof-of-possession token.

Parameters:
proofTokenInfo - a reference to the KeyInfoType that wraps the proof-of-possession token.

getClaimedAttributes

public Map<String,Object> getClaimedAttributes()

Gets the Map that contains the attributes claimed by the caller. Token providers use this method to obtain the attributes that must be inserted in the security token.

Returns:
a Map<String, Object> that contains the caller's attributes keyed by the attribute name.

setClaimedAttributes

public void setClaimedAttributes(Map<String,Object> attributes)

Sets the caller's attributes. The caller uses the Claims section of the WS-Trust request to specify the attributes that need to be present in the generated security token. The token service parses this section and (possibly) interacts with other services to determine the values of the required attributes. After the attributes have been determined the STS uses this method to set them in the request context and make them available for token providers.

Parameters:
attributes - a Map<String, Object that contains the caller's attributes keyed by the attribute name.

getSecurityToken

public SecurityToken getSecurityToken()

Obtains the security token set by the token provider.

Returns:
a reference to the SecurityToken instance.

setSecurityToken

public void setSecurityToken(SecurityToken token)

Sets the security token in the context.

Parameters:
token - the SecurityToken instance to be set.

getStatus

public StatusType getStatus()

Obtains the status of the security token validation.

Returns:
a reference to the resulting StatusType.

setStatus

public void setStatus(StatusType status)

Sets the status of the security token validation.

Parameters:
status - a reference to the StatusType that represents the validation status.

getAttachedReference

public RequestedReferenceType getAttachedReference()

Obtains the security token attached reference. This reference is used to locate the token inside the WS-Trust response message when that token doesn't support references using URI fragments.

Returns:
a RequestedReferenceType representing the attached reference.

setAttachedReference

public void setAttachedReference(RequestedReferenceType attachedReference)

Sets the security token attached reference. This reference is used to locate the token inside the WS-Trust response message when that token doesn't support references using URI fragments.

Parameters:
attachedReference - a RequestedReferenceType representing the attached reference.

getUnattachedReference

public RequestedReferenceType getUnattachedReference()

Obtains the security token unattached reference. This reference is used to locate the token when it is not placed inside the WS-Trust response message.

Returns:
a RequestedReferenceType representing the unattached reference.

setUnattachedReference

public void setUnattachedReference(RequestedReferenceType unattachedReference)

Sets the security token unattached reference. This reference is used to locate the token when it is not placed inside the WS-Trust response message.

Parameters:
unattachedReference - a RequestedReferenceType representing the unattached reference.

serviceName

public String serviceName()
Description copied from interface: ProtocolContext
An optional service name

Specified by:
serviceName in interface ProtocolContext
Returns:
See Also:
ProtocolContext.serviceName()

tokenType

public String tokenType()
Description copied from interface: ProtocolContext
A String that represents the token type

Specified by:
tokenType in interface ProtocolContext
Returns:
See Also:
ProtocolContext.tokenType()

setTokenType

public void setTokenType(String tokenType)

getQName

public QName getQName()
Description copied from interface: ProtocolContext
Return the QName of the token

Specified by:
getQName in interface ProtocolContext
Returns:
See Also:
ProtocolContext.getQName()

setQName

public void setQName(QName qname)

family

public String family()
Description copied from interface: ProtocolContext
What family the context belongs to..

Specified by:
family in interface ProtocolContext
Returns:
See Also:
ProtocolContext.family()

toString

public String toString()
Overrides:
toString in class Object

PicketLink Federation Core 2.1.6.Final-redhat-2

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.