Kerberos Token is not created

Discussion in 'Introductions' started by DeepakBangalore, Mar 3, 2017.

  1. DeepakBangalore

    DeepakBangalore

    Joined:
    Mar 3, 2017
    Messages:
    1
    Likes Received:
    0
    Public Void Method1()

    {

    Service1 serviceProxy = new Service1();

    serviceProxy.UseDefaultCredentials = true;

    serviceProxy.RequireMtom = true;




    KerberosAssertion assertion = new KerberosAssertion();


    KerberosToken token = GetSecurityToken();



    assertion.EstablishSecurityContext = false;

    assertion.RenewExpiredSecurityContext = true;

    assertion.RequireSignatureConfirmation = false;

    assertion.MessageProtectionOrder = MessageProtectionOrder.SignBeforeEncrypt;

    assertion.RequireDerivedKeys = true;

    assertion.TtlInSeconds = 300;

    assertion.Protection.Request.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeAddressing;

    assertion.Protection.Request.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeTimestamp;

    assertion.Protection.Request.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeSoapBody;

    assertion.Protection.Request.EncryptBody = true;

    assertion.Protection.Response.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeAddressing;

    assertion.Protection.Response.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeTimestamp;

    assertion.Protection.Response.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeSoapBody;

    assertion.Protection.Response.EncryptBody = true;

    assertion.Protection.Fault.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeAddressing;

    assertion.Protection.Fault.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeTimestamp;

    assertion.Protection.Fault.SignatureOptions = Microsoft.Web.Services3.Security.SignatureOptions.IncludeSoapBody;

    assertion.Protection.Fault.EncryptBody = false;







    serviceProxy.SetClientCredential(token);



    Policy policy = new Policy();

    policy.Assertions.Add(assertion);

    serviceProxy.SetPolicy(policy);



    string str = serviceProxy.HelloWorld();

    }

    KerberosToken GetSecurityToken()

    {





    KerberosToken securityToken = new KerberosToken(“host/INBLRN0143”, ImpersonationLevel.Impersonation);



    return securityToken;

    }

    But what happened, When I Debug the line KerberosToken token = GetSecurityToken();

    and see the token object in watch window, Key through the exception

    Key = 'securityToken.Key' threw an exception of type 'System.ArgumentException'

    But after refreshing the token object, it create the key


    Key = {Microsoft.Web.Services3.Security.Cryptography.AES128}

    I don't understand why this kind of error is coming.
     
    DeepakBangalore, Mar 3, 2017
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.