none
How to pass extra parameter to Security token(SecurityToken) in STS token authentication? RRS feed

  • Question

  • Hi,

    In out project we already have STS authentication enabled. ValidateToken method accepts Security token as parameter.

     public override ClaimsIdentityCollection ValidateToken(SecurityToken token)
            {
                Diag.LogTrace("[TellerUserNameSecurityTokenHandler::ValidateToken]", Severity.Verbose);
    
                InitializeResources();
    
                UserNameSecurityToken tokenUserName = token as UserNameSecurityToken;

    Now new requirement say they want one more parameter for authentication. How can i add new parameter to existing framework. Implementing custom security token is quite a lengthy code and i doubt it could break existing functionality.

    I can find help to create custom token on below link, but could not get full code example.

    Let me know if you know where i can full code for this to download.

    https://msdn.microsoft.com/en-us/library/ms752249(v=vs.110).aspx

    Kindly help me on this.


    • Edited by Sachin KH Monday, February 13, 2017 6:56 AM
    Monday, February 13, 2017 6:48 AM

All replies

  • Hi Sachin,

    >> I can find help to create custom token on below link, but could not get full code example.

    For code example, I suggest you download and set up from below link:

    # How to: Download the Windows Communication Foundation Samples

    https://msdn.microsoft.com/en-us/library/ms751450(v=vs.90).aspx

    After installing it, you could check “<install path>\WF_WCF_Samples\WCF\Extensibility\Security\CustomToken\CS”.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 14, 2017 3:17 AM