Package org.picketlink.identity.federation.core.sts

Examples of org.picketlink.identity.federation.core.sts.PicketLinkCoreSTS


        return new SamlProtocol().setSession(session);
    }

    @Override
    public void init(Config.Scope config) {
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        sts.installDefaultConfiguration();
    }
View Full Code Here


        // issue the security token using the constructed context.
        try {
            if (request.getTokenType() != null)
                requestContext.setTokenType(request.getTokenType().toString());
            PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
            sts.initialize(configuration);
            sts.issueToken(requestContext);
            // provider.issueToken(requestContext);
        } catch (ProcessingException e) {
            throw logger.stsError(e);
        }
View Full Code Here

            if (securityToken != null) {
                String ns = securityToken.getNamespaceURI();

                context.setQName(new QName(ns, securityToken.getLocalName()));
            }
            PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
            sts.initialize(configuration);
            sts.renewToken(context);
            // provider.renewToken(context);
        } catch (ProcessingException e) {
            throw new WSTrustException(e.getMessage(), e);
        }
View Full Code Here

        if (status == null) {
            logger.trace("Delegating token validation to token provider. Token NS: " + securityToken.getNamespaceURI() + " ::LocalName: " + securityToken.getLocalName());
            try {
                if (securityToken != null)
                    context.setQName(new QName(securityToken.getNamespaceURI(), securityToken.getLocalName()));
                PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
                sts.initialize(configuration);
                sts.validateToken(context);
                // provider.validateToken(context);
            } catch (ProcessingException e) {
                throw logger.stsError(e);
            }
            status = context.getStatus();
View Full Code Here

            context.setOnBehalfOfPrincipal(onBehalfOfPrincipal);
        }
        try {
            if (securityToken != null)
                context.setQName(new QName(securityToken.getNamespaceURI(), securityToken.getLocalName()));
            PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
            sts.initialize(configuration);
            sts.cancelToken(context);
            // provider.cancelToken(context);
        } catch (ProcessingException e) {
            throw logger.stsError(e);
        }
View Full Code Here

                }
            }
        }

        // Ensure the configuration in the STS
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        // Let us look for a file
        String configPath = context.getRealPath("/WEB-INF/picketlink-sts.xml");
        File stsConfigFile = configPath != null ? new File(configPath) : null;

        if (stsConfigFile == null || !stsConfigFile.exists())
            sts.installDefaultConfiguration();
        else
            sts.installDefaultConfiguration(configPath);
    }
View Full Code Here

*/
public class XMLEncryptionUnitTestCase extends TestCase {
    SAML2Response sr = new SAML2Response();

    public void testEncryptAssertion() throws Exception {
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        sts.installDefaultConfiguration();

        KeyPair kp = this.getKeyPair("RSA");
        SecretKey sk = this.getSecretKey();

        ResponseType rt = createResponse();
View Full Code Here

*/
public class SAML2AuthnResponseUnitTestCase {
    @Test
    public void testResponseTypeCreation() throws Exception {
        // Initialize the Core STS
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        sts.installDefaultConfiguration();

        IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://idp");
        issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());

        IDPInfoHolder idp = new IDPInfoHolder();
View Full Code Here

     * Initializes the STS configuration.
     */
    protected void initSTSConfiguration() {
        // if the sts configuration is present in the picketlink.xml then load it.
        if (this.picketLinkConfiguration != null && this.picketLinkConfiguration.getStsType() != null) {
            PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
            sts.initialize(new PicketLinkSTSConfiguration(this.picketLinkConfiguration.getStsType()));
        } else {
            // Try to load from /WEB-INF/picketlink-sts.xml.

            // Ensure that the Core STS has the SAML20 Token Provider
            PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
            // Let us look for a file
            String configPath = getContext().getServletContext().getRealPath("/WEB-INF/picketlink-sts.xml");
            File stsTokenConfigFile = configPath != null ? new File(configPath) : null;

            if (stsTokenConfigFile == null || stsTokenConfigFile.exists() == false) {
                logger.samlIDPInstallingDefaultSTSConfig();
                sts.installDefaultConfiguration();
            } else
                sts.installDefaultConfiguration(stsTokenConfigFile.toURI().toString());
        }
    }
View Full Code Here

                return "testPrincipal";
            }
        });

        // Init Picketlink Core STS
        PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
        sts.installDefaultConfiguration();

        // Init identityServer
        IdentityServer identityServer = new IdentityServer();
        httpContext.getServletContext().setAttribute(GeneralConstants.IDENTITY_SERVER, identityServer);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.sts.PicketLinkCoreSTS

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.