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.
Constructor and Description |
---|
WSTrustRequestContext(RequestSecurityToken request,
Principal callerPrincipal)
Creates an instance of
WSTrustRequestContext using the specified request. |
Modifier and Type | Method and Description |
---|---|
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() |
public WSTrustRequestContext(RequestSecurityToken request, Principal callerPrincipal)
Creates an instance of WSTrustRequestContext
using the specified request.
request
- a RequestSecurityToken
object that contains the information about the security token
request.callerPrincipal
- the Principal
of the security token requester.public String getTokenIssuer()
Obtains the name of the token issuer (security token service name).
String
representing the token issuer name.public void setTokenIssuer(String tokenIssuer)
Sets the name of the token issuer.
tokenIssuer
- a String
representing the token issuer name.public PublicKey getServiceProviderPublicKey()
Obtains the PublicKey
of the service provider that requires a security token.
PublicKey
.public void setServiceProviderPublicKey(PublicKey providerPublicKey)
Sets the PublicKey
of the service provider that requires a security token.
providerPublicKey
- the service provider's PublicKey
.public Principal getOnBehalfOfPrincipal()
Obtains the principal on behalf of which the WS-Trust request was made.
Principal
instance.public void setOnBehalfOfPrincipal(Principal onBehalfOfPrincipal)
Sets the principal on behalf of which the request was made.
onBehalfOfPrincipal
- a Principal
instance.public Principal getCallerPrincipal()
Obtains the principal of the WS-Trust token requester.
Principal
object.public RequestSecurityToken getRequestSecurityToken()
Obtains the object the contains the information about the security token request.
RequestSecurityToken
instance.public KeyInfoType getProofTokenInfo()
Obtains the KeyInfoType
that contains the proof-of-possession token.
KeyInfoType
that wraps the proof-of-possession token.public void setProofTokenInfo(KeyInfoType proofTokenInfo)
Sets the KeyInfoType
that contains the proof-of-possession token.
proofTokenInfo
- a reference to the KeyInfoType
that wraps the proof-of-possession token.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.
Map<String, Object>
that contains the caller's attributes keyed by the attribute name.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.
attributes
- a Map<String, Object
that contains the caller's attributes keyed by the attribute
name.public SecurityToken getSecurityToken()
Obtains the security token set by the token provider.
SecurityToken
instance.public void setSecurityToken(SecurityToken token)
Sets the security token in the context.
token
- the SecurityToken
instance to be set.public StatusType getStatus()
Obtains the status of the security token validation.
StatusType
.public void setStatus(StatusType status)
Sets the status of the security token validation.
status
- a reference to the StatusType
that represents the validation status.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.
RequestedReferenceType
representing the attached reference.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.
attachedReference
- a RequestedReferenceType
representing the attached reference.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.
RequestedReferenceType
representing the unattached reference.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.
unattachedReference
- a RequestedReferenceType
representing the unattached reference.public String serviceName()
ProtocolContext
serviceName
in interface ProtocolContext
ProtocolContext.serviceName()
public String tokenType()
ProtocolContext
tokenType
in interface ProtocolContext
ProtocolContext.tokenType()
public void setTokenType(String tokenType)
public QName getQName()
ProtocolContext
getQName
in interface ProtocolContext
ProtocolContext.getQName()
public void setQName(QName qname)
public String family()
ProtocolContext
family
in interface ProtocolContext
ProtocolContext.family()
Copyright © 2017 JBoss by Red Hat. All rights reserved.