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

[Bug] Microsoft.IdentityModel.Xml.XmlUtil.GetXsiTypeAsQualifiedName searches 'Type' attribute instead of 'type' #1873

Closed
1 task done
VirusQuartirus opened this issue Jun 10, 2022 · 2 comments · Fixed by #2894
Assignees
Labels
Bug Product is not functioning as expected Customer reported Indicates issue was opened by customer Good First Issue This is a good item for new team members P2 High, but not urgent. Needs to be addressed within the next couple of sprints
Milestone

Comments

@VirusQuartirus
Copy link

VirusQuartirus commented Jun 10, 2022

Which version of Microsoft.IdentityModel are you using?
Microsoft.IdentityModel.Tokens.Saml 6.18

Where is the issue?

  • M.IM.Tokens.Saml

Is this a new or an existing app?
New app

Repro
Saml2.xml

<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_e9c223c5-1792-4a85-9a44-938e0dcb017d" IssueInstant="2022-06-10T09:59:33.679Z" Version="2.0">
	<saml:Issuer>FooBar</saml:Issuer>
	<saml:Subject>
		<saml:NameID>UserKey</saml:NameID>
		<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"></saml:SubjectConfirmation>
	</saml:Subject>
	<saml:Conditions NotBefore="2022-06-10T09:59:33.665Z" NotOnOrAfter="2022-06-10T10:59:33.669Z">
		<saml:Condition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="saml:OneTimeUseType" />
	</saml:Conditions>
</saml:Assertion>
var tokenString = File.ReadAllText(@"Saml2.xml");
var handler = new Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenHandler();
var token = handler.ReadSaml2Token(tokenString);

Expected behavior
Token should be read successfully.

Actual behavior
Fails with following exception:
Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityTokenReadException
HResult=0x80131500
Message=IDX13119: An abstract element was encountered which does not specify its concrete type. Element name: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]' Namespace: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'
Source=Microsoft.IdentityModel.Tokens.Saml
StackTrace:
at Microsoft.IdentityModel.Tokens.Saml2.Saml2Serializer.ReadConditions(XmlDictionaryReader reader) in /_/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2Serializer.cs:line 879

Possible solution
Fix typo in XmlSignatureConstants.Attributes.Type.

@brentschmaltz brentschmaltz added P1 More important, prioritize highly Customer reported Indicates issue was opened by customer Bug Product is not functioning as expected labels Jun 16, 2022
@brentschmaltz brentschmaltz self-assigned this Jun 16, 2022
@brentschmaltz
Copy link
Member

You are correct, this is a bug, we will fix it.

@jennyf19 jennyf19 added P2 High, but not urgent. Needs to be addressed within the next couple of sprints Good First Issue This is a good item for new team members and removed P1 More important, prioritize highly labels Oct 4, 2024
@westin-m westin-m self-assigned this Oct 10, 2024
@westin-m westin-m mentioned this issue Oct 10, 2024
@pmaytak pmaytak added this to the 8.2.0 milestone Oct 10, 2024
@westin-m
Copy link
Contributor

Currently blocked on whether or not the signatures used to test DSig methods that use this field need to be replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Product is not functioning as expected Customer reported Indicates issue was opened by customer Good First Issue This is a good item for new team members P2 High, but not urgent. Needs to be addressed within the next couple of sprints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants