none
wsHTTpBinding RRS feed

  • Question

  • HI,

    I am trying to create saml token  using wshttpbinding-x509 certification.I want to create in code something related saml so that the client has to pass saml related code in soap header.

    I found some code .

    var requestSecurityToken = new RequestSecurityToken
    {
    AppliesTo = new EndpointReference(wcfServiceAddress),
    RequestType = RequestTypes.Issue,
    KeyType = KeyTypes.Asymmetric,
    ActAs = new SecurityTokenElement(bootstrapToken)
    };

    Here binding they have used Ws2007Federationbiding.Is that securitykeytype does not support in wshttpbinding.please suggest.

    Is SAML Token and STS are same??


    priyanka


    • Edited by Shankarbs Friday, September 5, 2014 1:43 PM
    Friday, September 5, 2014 1:36 PM

Answers

  • It seems that it is supported. Try check below code:
                var wsHttpBinding = new WSHttpBinding();
                wsHttpBinding.Security = new WSHttpSecurity();
                wsHttpBinding.Security.Mode = SecurityMode.Transport;
                var securityTokenParameters = new IssuedSecurityTokenParameters();
                securityTokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient;
                securityTokenParameters.ReferenceStyle = SecurityTokenReferenceStyle.Internal;
                securityTokenParameters.RequireDerivedKeys = false;
                securityTokenParameters.TokenType = null;
                securityTokenParameters.KeyType = SecurityKeyType.Asymmetric;
                securityTokenParameters.KeySize = 192;
                securityTokenParameters.IssuerAddress = new EndpointAddress("https://login.live.com/extSTS.srf");
                securityTokenParameters.IssuerMetadataAddress = null;
                securityTokenParameters.DefaultMessageSecurityVersion = null;
                securityTokenParameters.IssuerBinding = wsHttpBinding;



    Monday, September 8, 2014 9:21 AM