Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8456559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:34:30+00:00 2026-06-10T12:34:30+00:00

I am processing a SAML2 token in WIF which contains an EncryptedAssertion. The mark-up

  • 0

I am processing a SAML2 token in WIF which contains an EncryptedAssertion. The mark-up does NOT contain a “Subject Identifier Key” Extension property and as such WIF SecurityTokenHandler fails as it tries to get the correct X509 certificate from the LocalMachineStore/Personal.

The issue is clearly that the certificate used to encrypt the token does not contain the SKI Extension and of course the token generation code (Java) does not do seem to require it. To avoid having to modify the generation code is there a way I can get WIF SecuityTokenResolver to NOT check the received Token for the SKI but simply use the local store certificate directly to decrypt the token?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:34:31+00:00Added an answer on June 10, 2026 at 12:34 pm

    In the end I just implemented a custom SecurityTokenResolver and implemented the TryResolveSecurityKeyCore method.

    Here is the code:

    public class mySaml2SSOSecurityTokenResolver : SecurityTokenResolver
    {
        List<SecurityToken> _tokens;
    
        public PortalSSOSecurityTokenResolver(List<SecurityToken> tokens)
        {
            _tokens = tokens;
        }
        protected override bool TryResolveSecurityKeyCore(System.IdentityModel.Tokens.SecurityKeyIdentifierClause keyIdentifierClause, out System.IdentityModel.Tokens.SecurityKey key)
        {
            var token = _tokens[0] as X509SecurityToken;
    
            var myCert = token.Certificate;
    
            key = null;
    
            try
            {
    
                var ekec = keyIdentifierClause as EncryptedKeyIdentifierClause;
    
                if (ekec != null)
                {
    
                    switch (ekec.EncryptionMethod)
                    {
    
                        case "http://www.w3.org/2001/04/xmlenc#rsa-1_5":
                            {
                                var encKey = ekec.GetEncryptedKey();
    
                                var rsa = myCert.PrivateKey as RSACryptoServiceProvider;
    
                                var decKey = rsa.Decrypt(encKey, false);
    
                                key = new InMemorySymmetricSecurityKey(decKey);
    
                                return true;
    
                            }
    
                    }
    
                    var data = ekec.GetEncryptedKey();
    
                    var id = ekec.EncryptingKeyIdentifier;
    
                }
    
            }
    
            catch (Exception ex)
            {
               // Do something here            }
    
                return true;
    
        }
    
        protected override bool TryResolveTokenCore(System.IdentityModel.Tokens.SecurityKeyIdentifierClause keyIdentifierClause, out System.IdentityModel.Tokens.SecurityToken token)
        {
            throw new NotImplementedException();
        }
    
        protected override bool TryResolveTokenCore(System.IdentityModel.Tokens.SecurityKeyIdentifier keyIdentifier, out System.IdentityModel.Tokens.SecurityToken token)
        {
            throw new NotImplementedException();
        }
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm processing some 3rd party HTML which is semi-structured marked-up text (bold, italics, etc).
AudioPannerNode is a processing node which positions / spatializes an incoming audio stream in
I'm processing a text file output by a scientific instrument. I do not have
Which processing is fast Client-side or Server-side? for client side processing browser need to
My understanding is that Processing.js converts Processing code into javascript. But if one does
I am doing some processing in a back end page (thread.php) which basically returns
I am processing some CDRs (call detailed record). I dont know which exactly the
I have sample image processing code which applies a convolution filter over an image
I need to start processing a URL that will contain some emailand a GUID.
How does the processing overhead of the length() function in REXX change with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.