Search in sources :

Example 1 with KeyValueType

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

the class HandlerParameterAddHandler method toHandlerParameterConfig.

public static KeyValueType toHandlerParameterConfig(OperationContext context, String paramName, ModelNode parameterNode) throws OperationFailedException {
    String paramValue = HandlerParameterResourceDefinition.VALUE.resolveModelAttribute(context, parameterNode).asString();
    KeyValueType kv = new KeyValueType();
    kv.setKey(paramName);
    kv.setValue(paramValue);
    return kv;
}
Also used : KeyValueType(org.picketlink.config.federation.KeyValueType)

Example 2 with KeyValueType

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

the class HandlerParameterAddHandler method performRuntime.

@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
    PathAddress pathAddress = PathAddress.pathAddress(operation.get(ADDRESS));
    String providerAlias = pathAddress.subAddress(0, pathAddress.size() - 2).getLastElement().getValue();
    String handlerType = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();
    EntityProviderService providerService = EntityProviderService.getService(context, providerAlias);
    String handlerParameterName = pathAddress.getLastElement().getValue();
    KeyValueType keyValueType = toHandlerParameterConfig(context, handlerParameterName, model);
    providerService.addHandlerParameter(handlerType, keyValueType);
}
Also used : PathAddress(org.jboss.as.controller.PathAddress) KeyValueType(org.picketlink.config.federation.KeyValueType) EntityProviderService(org.wildfly.extension.picketlink.federation.service.EntityProviderService)

Example 3 with KeyValueType

use of org.picketlink.config.federation.KeyValueType 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)

Example 4 with KeyValueType

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

the class KeyStoreProviderService method addKey.

public void addKey(String key, String validatingHost) {
    removeKey(key);
    String[] hosts = validatingHost.split(",");
    for (String host : hosts) {
        KeyValueType kv = new KeyValueType();
        kv.setKey(host.trim());
        kv.setValue(key.trim());
        this.keyProviderType.add(kv);
    }
}
Also used : KeyValueType(org.picketlink.config.federation.KeyValueType)

Example 5 with KeyValueType

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

the class KeyStoreProviderService method setKeyProviderType.

public void setKeyProviderType(KeyProviderType keyProviderType, String file, String relativeTo) {
    if (keyProviderType != null) {
        for (KeyValueType kv : this.keyProviderType.getValidatingAlias()) {
            keyProviderType.add(kv);
        }
    }
    this.filePath = file;
    this.relativeTo = relativeTo;
    this.keyProviderType = keyProviderType;
    configureKeyStoreFilePath();
    getFederationService().getValue().setKeyProviderType(this.keyProviderType);
}
Also used : KeyValueType(org.picketlink.config.federation.KeyValueType)

Aggregations

KeyValueType (org.picketlink.config.federation.KeyValueType)6 AbstractAddStepHandler (org.jboss.as.controller.AbstractAddStepHandler)1 PathAddress (org.jboss.as.controller.PathAddress)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 STSType (org.picketlink.config.federation.STSType)1 TokenProviderType (org.picketlink.config.federation.TokenProviderType)1 Handler (org.picketlink.config.federation.handler.Handler)1 EntityProviderService (org.wildfly.extension.picketlink.federation.service.EntityProviderService)1