Search in sources :

Example 1 with Handler

use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.

the class HandlerAddHandler method toHandlerConfig.

public static Handler toHandlerConfig(OperationContext context, ModelNode handler) throws OperationFailedException {
    Handler newHandler = new Handler();
    String typeName = HandlerResourceDefinition.getHandlerType(context, handler);
    newHandler.setClazz(typeName);
    return newHandler;
}
Also used : Handler(org.picketlink.config.federation.handler.Handler) AbstractAddStepHandler(org.jboss.as.controller.AbstractAddStepHandler) UniqueTypeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler) AlternativeAttributeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler) ServiceVerificationHandler(org.jboss.as.controller.ServiceVerificationHandler)

Example 2 with Handler

use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.

the class HandlerAddHandler 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() - 1).getLastElement().getValue();
    EntityProviderService providerService = EntityProviderService.getService(context, providerAlias);
    Handler handler = toHandlerConfig(context, model);
    providerService.addHandler(handler);
}
Also used : PathAddress(org.jboss.as.controller.PathAddress) Handler(org.picketlink.config.federation.handler.Handler) AbstractAddStepHandler(org.jboss.as.controller.AbstractAddStepHandler) UniqueTypeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler) AlternativeAttributeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler) ServiceVerificationHandler(org.jboss.as.controller.ServiceVerificationHandler) EntityProviderService(org.wildfly.extension.picketlink.federation.service.EntityProviderService)

Example 3 with Handler

use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.

the class EntityProviderService method addHandler.

void addHandler(Class<? extends SAML2Handler> handlerClassName, Handlers handlers) {
    for (Handler handler : handlers.getHandler()) {
        if (handler.getClazz().equals(handlerClassName.getName())) {
            return;
        }
    }
    Handler handler = new Handler();
    handler.setClazz(handlerClassName.getName());
    handlers.add(handler);
}
Also used : SAML2Handler(org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2Handler) RolesGenerationHandler(org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler) Handler(org.picketlink.config.federation.handler.Handler) SAML2SignatureValidationHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler) SAML2LogOutHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler) SAML2AuthenticationHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler) SAML2EncryptionHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2EncryptionHandler)

Example 4 with Handler

use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.

the class EntityProviderService method configureHandlers.

/**
     * <p> Configure the SAML Handlers. </p>
     */
private void configureHandlers() {
    Handlers actualHandlers = new Handlers();
    actualHandlers.setHandlers(new ArrayList<Handler>());
    if (this.handlers.isEmpty()) {
        for (Class<? extends SAML2Handler> commonHandlerClass : getDefaultHandlers()) {
            addHandler(commonHandlerClass, actualHandlers);
        }
    } else {
        for (Handler handler : this.handlers) {
            actualHandlers.add(handler);
        }
    }
    getPicketLinkType().setHandlers(actualHandlers);
}
Also used : Handlers(org.picketlink.config.federation.handler.Handlers) SAML2Handler(org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2Handler) RolesGenerationHandler(org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler) Handler(org.picketlink.config.federation.handler.Handler) SAML2SignatureValidationHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler) SAML2LogOutHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler) SAML2AuthenticationHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler) SAML2EncryptionHandler(org.picketlink.identity.federation.web.handlers.saml2.SAML2EncryptionHandler)

Example 5 with Handler

use of org.picketlink.config.federation.handler.Handler in project wildfly by wildfly.

the class AbstractEntityProviderAddHandler method configureHandler.

protected static void configureHandler(OperationContext context, ModelNode model, EntityProviderService service) throws OperationFailedException {
    if (model.hasDefined(ModelElement.COMMON_HANDLER.getName())) {
        for (Property handlerProperty : model.get(ModelElement.COMMON_HANDLER.getName()).asPropertyList()) {
            ModelNode handler = handlerProperty.getValue();
            Handler newHandler = toHandlerConfig(context, handler);
            if (handler.hasDefined(COMMON_HANDLER_PARAMETER.getName())) {
                for (Property handlerParameter : handler.get(COMMON_HANDLER_PARAMETER.getName()).asPropertyList()) {
                    String paramName = handlerParameter.getName();
                    ModelNode parameterNode = handlerParameter.getValue();
                    KeyValueType kv = toHandlerParameterConfig(context, paramName, parameterNode);
                    newHandler.add(kv);
                }
            }
            service.addHandler(newHandler);
        }
    }
}
Also used : KeyValueType(org.picketlink.config.federation.KeyValueType) AbstractAddStepHandler(org.jboss.as.controller.AbstractAddStepHandler) Handler(org.picketlink.config.federation.handler.Handler) ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Aggregations

Handler (org.picketlink.config.federation.handler.Handler)5 AbstractAddStepHandler (org.jboss.as.controller.AbstractAddStepHandler)3 ServiceVerificationHandler (org.jboss.as.controller.ServiceVerificationHandler)2 SAML2Handler (org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2Handler)2 RolesGenerationHandler (org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler)2 SAML2AuthenticationHandler (org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler)2 SAML2EncryptionHandler (org.picketlink.identity.federation.web.handlers.saml2.SAML2EncryptionHandler)2 SAML2LogOutHandler (org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler)2 SAML2SignatureValidationHandler (org.picketlink.identity.federation.web.handlers.saml2.SAML2SignatureValidationHandler)2 AlternativeAttributeValidationStepHandler (org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler)2 UniqueTypeValidationStepHandler (org.wildfly.extension.picketlink.common.model.validator.UniqueTypeValidationStepHandler)2 PathAddress (org.jboss.as.controller.PathAddress)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 KeyValueType (org.picketlink.config.federation.KeyValueType)1 Handlers (org.picketlink.config.federation.handler.Handlers)1 EntityProviderService (org.wildfly.extension.picketlink.federation.service.EntityProviderService)1