Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameID Missing in SAML 2 token #43

Open
dimef opened this issue Jul 4, 2019 · 2 comments
Open

NameID Missing in SAML 2 token #43

dimef opened this issue Jul 4, 2019 · 2 comments
Assignees

Comments

@dimef
Copy link

dimef commented Jul 4, 2019

Name Identifier is missing in the WS Federation token, here is the XML tag:

      <saml:Subject>
        <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" />
      </saml:Subject>

a very fast fix:

        public async Task<string> GenerateSerializedRstr(ValidatedWsFederationSigninRequest request)
        {
            var principal = request.Subject.Identity as ClaimsIdentity;
            if (principal.FindFirst(ClaimTypes.NameIdentifier) == null) {
                principal.AddClaim(new Claim(ClaimTypes.NameIdentifier, principal.Name));
            }
          .......

I may create a PR with the code change

@ellenfieldn
Copy link
Owner

I'll try to put a fix in this weekend.

@ellenfieldn ellenfieldn self-assigned this Jul 6, 2019
@ellenfieldn
Copy link
Owner

I have a PR out #45 if you want to look.

I'll complete it in a day or so along with whatever else I decide to put in the next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants