Class DefaultConditionsProvider
- java.lang.Object
-
- org.apache.cxf.sts.token.provider.DefaultConditionsProvider
-
- All Implemented Interfaces:
ConditionsProvider
public class DefaultConditionsProvider extends Object implements ConditionsProvider
A default implementation of the ConditionsProvider interface.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_MAX_LIFETIME
-
Constructor Summary
Constructors Constructor Description DefaultConditionsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.apache.wss4j.common.saml.bean.AudienceRestrictionBean>createAudienceRestrictions(TokenProviderParameters providerParameters)Create a list of AudienceRestrictions to be added to the Conditions Element of the issued Assertion.protected StringextractAddressFromParticipantsEPR(Object participants)Extract an address from a Participants EPR DOM elementorg.apache.wss4j.common.saml.bean.ConditionsBeangetConditions(TokenProviderParameters providerParameters)Get a ConditionsBean object.longgetFutureTimeToLive()Get how long (in seconds) a client-supplied Created Element is allowed to be in the future.longgetLifetime()Get the default lifetime in seconds for issued SAML token where requestor doesn't specify a lifetime elementlonggetMaxLifetime()Get the maximum lifetime in seconds for issued SAML token if requestor specifies lifetime elementbooleanisAcceptClientLifetime()Is client lifetime element accepted Default: falsebooleanisFailLifetimeExceedance()If requested lifetime exceeds shall it fail (default) or overwrite with maximum lifetimevoidsetAcceptClientLifetime(boolean acceptClientLifetime)Set whether client lifetime is acceptedvoidsetFailLifetimeExceedance(boolean failLifetimeExceedance)If requested lifetime exceeds shall it fail (default) or overwrite with maximum lifetimevoidsetFutureTimeToLive(long futureTimeToLive)Set how long (in seconds) a client-supplied Created Element is allowed to be in the future.voidsetLifetime(long lifetime)Set the default lifetime in seconds for issued SAML tokensvoidsetMaxLifetime(long maxLifetime)Set the maximum lifetime in seconds for issued SAML tokens
-
-
-
Field Detail
-
DEFAULT_MAX_LIFETIME
public static final long DEFAULT_MAX_LIFETIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFutureTimeToLive
public long getFutureTimeToLive()
Get how long (in seconds) a client-supplied Created Element is allowed to be in the future. The default is 60 seconds to avoid common problems relating to clock skew.
-
setFutureTimeToLive
public void setFutureTimeToLive(long futureTimeToLive)
Set how long (in seconds) a client-supplied Created Element is allowed to be in the future. The default is 60 seconds to avoid common problems relating to clock skew.
-
setLifetime
public void setLifetime(long lifetime)
Set the default lifetime in seconds for issued SAML tokens- Parameters:
lifetime- default lifetime in seconds
-
getLifetime
public long getLifetime()
Get the default lifetime in seconds for issued SAML token where requestor doesn't specify a lifetime element- Specified by:
getLifetimein interfaceConditionsProvider- Returns:
- the lifetime in seconds
-
setMaxLifetime
public void setMaxLifetime(long maxLifetime)
Set the maximum lifetime in seconds for issued SAML tokens- Parameters:
maxLifetime- maximum lifetime in seconds
-
getMaxLifetime
public long getMaxLifetime()
Get the maximum lifetime in seconds for issued SAML token if requestor specifies lifetime element- Returns:
- the maximum lifetime in seconds
-
isAcceptClientLifetime
public boolean isAcceptClientLifetime()
Is client lifetime element accepted Default: false
-
setAcceptClientLifetime
public void setAcceptClientLifetime(boolean acceptClientLifetime)
Set whether client lifetime is accepted
-
isFailLifetimeExceedance
public boolean isFailLifetimeExceedance()
If requested lifetime exceeds shall it fail (default) or overwrite with maximum lifetime
-
setFailLifetimeExceedance
public void setFailLifetimeExceedance(boolean failLifetimeExceedance)
If requested lifetime exceeds shall it fail (default) or overwrite with maximum lifetime
-
getConditions
public org.apache.wss4j.common.saml.bean.ConditionsBean getConditions(TokenProviderParameters providerParameters)
Get a ConditionsBean object.- Specified by:
getConditionsin interfaceConditionsProvider
-
createAudienceRestrictions
protected List<org.apache.wss4j.common.saml.bean.AudienceRestrictionBean> createAudienceRestrictions(TokenProviderParameters providerParameters)
Create a list of AudienceRestrictions to be added to the Conditions Element of the issued Assertion. The default behaviour is to add a single Audience URI per AudienceRestriction Element. The Audience URIs are from an AppliesTo address, and the wst:Participants (if either exist).
-
-