Examples of RequestSecurityToken


Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeCustom() throws Exception {
        // create a simple token request, asking for a "special" test token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST,
                "http://www.tokens.org/SpecialToken", null);
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML11() throws Exception {
        // create a simple token request, asking for a SAMLv1.1 token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST,
                SAMLUtil.SAML11_TOKEN_TYPE, null);
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML20() throws Exception {
        // create a simple token request, asking for a SAMLv2.0 token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST,
                SAMLUtil.SAML2_TOKEN_TYPE, null);
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception
     */
    @Test
    public void testInvokeSAML20WithSOAP12() throws Exception {
        // create a simple token request, asking for a SAMLv2.0 token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST,
                SAMLUtil.SAML2_TOKEN_TYPE, null);
        Source requestMessage = this.createSourceFromRequest(request);

        this.tokenService.setSoap12(true); // Set to SOAP12
        try {
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeCustomAppliesTo() throws Exception {
        // create a simple token request, this time using the applies to get to the token type.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST, null,
                "http://services.testcorp.org/provider1");
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     *
     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML20AppliesTo() throws Exception {
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST, null,
                "http://services.testcorp.org/provider2");
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML20OnBehalfOf() throws Exception {
        // create a simple token request, asking for a SAMLv2.0 token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST,
                SAMLUtil.SAML2_TOKEN_TYPE, null);
        OnBehalfOfType onBehalfOf = WSTrustUtil.createOnBehalfOfWithUsername("anotherduke", "id");
        request.setOnBehalfOf(onBehalfOf);

        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML20WithSTSGeneratedSymmetricKey() throws Exception {
        // create a simple token request, asking for a SAMLv2.0 token.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST, null,
                "http://services.testcorp.org/provider2");

        // add a symmetric key type to the request, but don't supply any client key - STS should generate one.
        request.setKeyType(URI.create(WSTrustConstants.KEY_TYPE_SYMMETRIC));
        Source requestMessage = this.createSourceFromRequest(request);

        // invoke the token service.
        Source responseMessage = this.tokenService.invoke(requestMessage);
        BaseRequestSecurityTokenResponse baseResponse = (BaseRequestSecurityTokenResponse) new WSTrustParser()
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

        // set the client secret in the client entropy.
        EntropyType clientEntropy = new EntropyType();
        clientEntropy.addAny(clientBinarySecret);

        // create a token request specifying the key type, key size, and client entropy.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST, null,
                "http://services.testcorp.org/provider2");
        request.setKeyType(URI.create(WSTrustConstants.KEY_TYPE_SYMMETRIC));
        request.setEntropy(clientEntropy);
        request.setKeySize(64);

        // invoke the token service.
        Source requestMessage = this.createSourceFromRequest(request);
        Source responseMessage = this.tokenService.invoke(requestMessage);
        BaseRequestSecurityTokenResponse baseResponse = (BaseRequestSecurityTokenResponse) new WSTrustParser()
View Full Code Here

Examples of org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken

     * @throws Exception if an error occurs while running the test.
     */
    @Test
    public void testInvokeSAML20WithCertificate() throws Exception {
        // create a simple token request.
        RequestSecurityToken request = this.createRequest("testcontext", WSTrustConstants.ISSUE_REQUEST, null,
                "http://services.testcorp.org/provider2");
        request.setKeyType(URI.create(WSTrustConstants.KEY_TYPE_PUBLIC));

        // include a UseKey section that specifies the certificate in the request.
        Certificate certificate = this.getCertificate("keystore/sts_keystore.jks", "testpass", "service1");
        UseKeyType useKey = new UseKeyType();
        useKey.add(Base64.encodeBytes(certificate.getEncoded()).getBytes());
        request.setUseKey(useKey);

        // invoke the token service.
        Source requestMessage = this.createSourceFromRequest(request);
        Source responseMessage = this.tokenService.invoke(requestMessage);
        BaseRequestSecurityTokenResponse baseResponse = (BaseRequestSecurityTokenResponse) new WSTrustParser()
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.