Package org.wildfly.extension.picketlink.federation.config

Examples of org.wildfly.extension.picketlink.federation.config.IDPConfiguration


    @Override
    public IDPType getIDPConfiguration() {
        ProviderType providerType = getPicketLinkConfiguration().getIdpOrSP();

        if (providerType instanceof IDPConfiguration) {
            IDPConfiguration configuration = (IDPConfiguration) providerType;

            if (configuration.isSupportMetadata()) {
                try {
                    IDPType metadataConfig = new IDPMetadataConfigurationProvider().getIDPConfiguration();

                    metadataConfig.importFrom(configuration);

                    providerType = metadataConfig;
                } catch (ProcessingException e) {
                    throw PicketLinkLogger.ROOT_LOGGER.federationSAMLMetadataConfigError(configuration.getAlias(), e);
                }
            }

            if (configParsedIDPType != null) {
                configuration.importFrom(configParsedIDPType);
            }

            return (IDPType) providerType;
        }
View Full Code Here


        String federationAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();

        serviceBuilder.addDependency(FederationService.createServiceName(federationAlias), FederationService.class,
                                            service.getFederationService());

        IDPConfiguration configuration = service.getConfiguration();

        if (!configuration.isExternal()) {
            serviceBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(configuration.getSecurityDomain()));
        }

        if (verificationHandler != null) {
            serviceBuilder.addListener(verificationHandler);
        }
View Full Code Here

            newControllers.add(controller);
        }
    }

    private static IDPConfiguration toIDPConfig(OperationContext context, ModelNode fromModel, String alias) throws OperationFailedException {
        IDPConfiguration idpType = new IDPConfiguration(alias);

        boolean external = IdentityProviderResourceDefinition.EXTERNAL.resolveModelAttribute(context, fromModel).asBoolean();

        idpType.setExternal(external);

        String url = IdentityProviderResourceDefinition.URL.resolveModelAttribute(context, fromModel).asString();

        idpType.setIdentityURL(url);

        if (!idpType.isExternal()) {
            ModelNode securityDomain = IdentityProviderResourceDefinition.SECURITY_DOMAIN.resolveModelAttribute(context, fromModel);

            if (securityDomain.isDefined()) {
                idpType.setSecurityDomain(securityDomain.asString());
            } else {
                throw ROOT_LOGGER.requiredAttribute(ModelElement.COMMON_SECURITY_DOMAIN.getName(), alias);
            }

            boolean supportsSignatures = IdentityProviderResourceDefinition.SUPPORT_SIGNATURES.resolveModelAttribute(context, fromModel).asBoolean();

            idpType.setSupportsSignature(supportsSignatures);

            boolean supportsMetadata = IdentityProviderResourceDefinition.SUPPORT_METADATA.resolveModelAttribute(context, fromModel).asBoolean();

            idpType.setSupportMetadata(supportsMetadata);

            boolean encrypt = IdentityProviderResourceDefinition.ENCRYPT.resolveModelAttribute(context, fromModel).asBoolean();

            idpType.setEncrypt(encrypt);

            boolean sslAuthentication = IdentityProviderResourceDefinition.SSL_AUTHENTICATION.resolveModelAttribute(context, fromModel).asBoolean();

            idpType.setSSLClientAuthentication(sslAuthentication);

            boolean strictPostBinding = IdentityProviderResourceDefinition.STRICT_POST_BINDING.resolveModelAttribute(context, fromModel).asBoolean();

            idpType.setStrictPostBinding(strictPostBinding);

            ModelNode roleGenerator = fromModel.get(ModelElement.IDENTITY_PROVIDER_ROLE_GENERATOR.getName());
            String roleGeneratorType;

            if (roleGenerator.isDefined()) {
                //TODO: resolve PLINK-
                ModelNode roleGeneratorValue = roleGenerator.asProperty().getValue();
                ModelNode classNameNode = RoleGeneratorResourceDefinition.CLASS_NAME.resolveModelAttribute(context, roleGeneratorValue);
                ModelNode codeNode = RoleGeneratorResourceDefinition.CODE.resolveModelAttribute(context, roleGeneratorValue);

                if (classNameNode.isDefined()) {
                    roleGeneratorType = classNameNode.asString();
                } else if (codeNode.isDefined()) {
                    roleGeneratorType = RoleGeneratorTypeEnum.forType(codeNode.asString());
                } else {
                    throw ROOT_LOGGER.typeNotProvided(IDENTITY_PROVIDER_ROLE_GENERATOR.getName());
                }
            } else {
                roleGeneratorType = UndertowRoleGenerator.class.getName();
            }

            idpType.setRoleGenerator(roleGeneratorType);

            ModelNode attributeManager = fromModel.get(ModelElement.IDENTITY_PROVIDER_ATTRIBUTE_MANAGER.getName());
            String attributeManagerType;

            if (attributeManager.isDefined()) {
                ModelNode attributeManagerValue = attributeManager.asProperty().getValue();
                ModelNode classNameNode = AttributeManagerResourceDefinition.CLASS_NAME.resolveModelAttribute(context, attributeManagerValue);
                ModelNode codeNode = AttributeManagerResourceDefinition.CODE.resolveModelAttribute(context, attributeManagerValue);

                if (classNameNode.isDefined()) {
                    attributeManagerType = classNameNode.asString();
                } else if (codeNode.isDefined()) {
                    attributeManagerType = AttributeManagerTypeEnum.forType(codeNode.asString());
                } else {
                    throw ROOT_LOGGER.typeNotProvided(IDENTITY_PROVIDER_ATTRIBUTE_MANAGER.getName());
                }
            } else {
                attributeManagerType = UndertowAttributeManager.class.getName();
            }

            idpType.setAttributeManager(attributeManagerType);
        }

        return idpType;
    }
View Full Code Here

        return defaultHandlers;

    }

    private void configureIdentityProvider() {
        IDPConfiguration idpConfiguration = getFederationService().getValue().getIdpConfiguration();

        if (idpConfiguration == null) {
            throw PicketLinkLogger.ROOT_LOGGER.federationIdentityProviderNotConfigured(getFederationService().getValue().getAlias());
        }

        getConfiguration().setIdentityURL(idpConfiguration.getIdentityURL());
    }
View Full Code Here

        if (service == null) {
            service = serviceRegistry.getService(ServiceProviderService.createServiceName(deployment.getName()));
        } else {
            IdentityProviderService identityProviderService = (IdentityProviderService) service.getService();
            IDPConfiguration idpType = identityProviderService.getValue().getConfiguration();

            if (idpType.isExternal()) {
                return null;
            }
        }

        if (service == null) {
View Full Code Here

TOP

Related Classes of org.wildfly.extension.picketlink.federation.config.IDPConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.