Examples of WSTrustServiceFactory


Examples of org.jboss.identity.federation.api.wstrust.WSTrustServiceFactory

      // build the token-provider and service-metadata maps.
      TokenProvidersType providers = this.delegate.getTokenProviders();
      if (providers != null)
      {
         WSTrustServiceFactory serviceFactory = WSTrustServiceFactory.getInstance();
         for (TokenProviderType provider : providers.getTokenProvider())
         {
            this.tokenProviders.put(provider.getTokenType(), serviceFactory.createTokenProvider(provider
                  .getProviderClass()));
         }
      }
      ServiceProvidersType serviceProviders = this.delegate.getServiceProviders();
      if (serviceProviders != null)
View Full Code Here

Examples of org.jboss.identity.federation.core.wstrust.WSTrustServiceFactory

      // build the token-provider and service-metadata maps.
      TokenProvidersType providers = this.delegate.getTokenProviders();
      if (providers != null)
      {
         WSTrustServiceFactory serviceFactory = WSTrustServiceFactory.getInstance();
         for (TokenProviderType provider : providers.getTokenProvider())
         {
            // create and initialize the token provider.
            SecurityTokenProvider tokenProvider = serviceFactory.createTokenProvider(provider.getProviderClass());
            Map<String, String> properties = new HashMap<String, String>();
            for(PropertyType propertyType : provider.getProperty())
               properties.put(propertyType.getName(), propertyType.getValue());
            tokenProvider.initialize(properties);
            // token providers can be keyed by the token type and by token element + namespace.
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustServiceFactory

        InputStream configStream = cl.getResourceAsStream("sts/picketlink-sts.xml");
        STSConfigParser configParser = new STSConfigParser();
        STSType stsType = (STSType) configParser.parse(configStream);

        STSConfiguration config = new PicketLinkSTSConfiguration(stsType);
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        InputStream is = getClass().getClassLoader().getResourceAsStream("wstrust/wstrust-rst-usekey.xml");
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustServiceFactory

     *
     * @throws Exception if an error occurs while running the test.
     */
    public void testCreateRequestHandler() throws Exception {
        STSConfiguration config = new PicketLinkSTSConfiguration();
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();

        // tests the creation of the request handler.
        WSTrustRequestHandler handler = factory.createRequestHandler(
                "org.picketlink.identity.federation.core.wstrust.StandardRequestHandler", config);
        assertNotNull("Unexpected null request handler", handler);
        assertTrue("Unexpected request handler type", handler instanceof StandardRequestHandler);

        // try to create an invalid instance of request handler.
        try {
            factory.createRequestHandler("InvalidHandler", config);
            fail("An exception should have been raised");
        } catch (RuntimeException re) {
            String msg = re.getCause().getMessage();
            assertTrue(msg.contains("Class Not Loaded"));
        }
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.WSTrustServiceFactory

     * </p>
     *
     * @throws Exception if an error occurs while running the test.
     */
    public void testCreateTokenProvider() throws Exception {
        WSTrustServiceFactory factory = WSTrustServiceFactory.getInstance();
        SecurityTokenProvider provider = factory.createTokenProvider(
                "org.picketlink.test.identity.federation.core.wstrust.SpecialTokenProvider", null);
        assertNotNull("Unexpected null token provider", provider);
        assertTrue("Unexpected token provider type", provider instanceof SpecialTokenProvider);
        provider = factory.createTokenProvider(
                "org.picketlink.identity.federation.core.wstrust.plugins.saml.SAML20TokenProvider",
                new HashMap<String, String>());
        assertNotNull("Unexpected null token provider", provider);
        assertTrue("Unexpected token provider type", provider instanceof SAML20TokenProvider);

        // try to create an invalid token provider.
        try {
            factory.createTokenProvider("InvalidTokenProvider", null);
            fail("An exception should have been raised");
        } catch (RuntimeException re) {
            String msg = re.getCause().getMessage();
            assertTrue(msg.contains("Cannot create instance"));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.