Search in sources :

Example 1 with TokenProviderType

use of org.picketlink.config.federation.TokenProviderType in project wildfly by wildfly.

the class EntityProviderService method configureTokenProviders.

/**
     * <p> Configure the STS Token Providers. </p>
     */
private void configureTokenProviders() {
    STSType stsType = getFederationService().getValue().getStsType();
    if (stsType != null) {
        int tokenTimeout = stsType.getTokenTimeout();
        int clockSkew = stsType.getClockSkew();
        STSType providerStsType = getPicketLinkType().getStsType();
        providerStsType.setTokenTimeout(tokenTimeout);
        providerStsType.setClockSkew(clockSkew);
        List<TokenProviderType> tokenProviders = providerStsType.getTokenProviders().getTokenProvider();
        for (TokenProviderType tokenProviderType : tokenProviders) {
            if (tokenProviderType.getTokenType().equals(JBossSAMLURIConstants.ASSERTION_NSURI.get())) {
                KeyValueType keyValueTypeTokenTimeout = new KeyValueType();
                keyValueTypeTokenTimeout.setKey(GeneralConstants.ASSERTIONS_VALIDITY);
                keyValueTypeTokenTimeout.setValue(String.valueOf(tokenTimeout));
                KeyValueType keyValueTypeClockSkew = new KeyValueType();
                keyValueTypeClockSkew.setKey(GeneralConstants.CLOCK_SKEW);
                keyValueTypeClockSkew.setValue(String.valueOf(clockSkew));
                tokenProviderType.add(keyValueTypeTokenTimeout);
                tokenProviderType.add(keyValueTypeClockSkew);
            }
        }
    }
}
Also used : KeyValueType(org.picketlink.config.federation.KeyValueType) STSType(org.picketlink.config.federation.STSType) TokenProviderType(org.picketlink.config.federation.TokenProviderType)

Aggregations

KeyValueType (org.picketlink.config.federation.KeyValueType)1 STSType (org.picketlink.config.federation.STSType)1 TokenProviderType (org.picketlink.config.federation.TokenProviderType)1