// Create handlers
SAML2AuthenticationHandler authenticationHandler = new SAML2AuthenticationHandler();
SAML2InResponseToVerificationHandler verificationHandler = new SAML2InResponseToVerificationHandler();
// Create configuration for handlers
SAML2HandlerChainConfig chainConfig = new DefaultSAML2HandlerChainConfig();
SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig();
handlerConfig.addParameter(GeneralConstants.NAMEID_FORMAT, JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());
handlerConfig.addParameter(SAML2Handler.DISABLE_SENDING_ROLES, "true");
Map<String, Object> chainOptions = new HashMap<String, Object>();
ProviderType spType = new SPType();
chainOptions.put(GeneralConstants.CONFIGURATION, spType);
chainOptions.put(GeneralConstants.ROLE_VALIDATOR_IGNORE, "true");
chainConfig.set(chainOptions);
// Initialize the handlers
authenticationHandler.initChainConfig(chainConfig);
authenticationHandler.initHandlerConfig(handlerConfig);
verificationHandler.initChainConfig(chainConfig);