Skip to content

Add more apis for generic xml security token#4703

Merged
HongGit merged 1 commit intodotnet:mainfrom
mconnew:GenericXmlSecurityToken
Sep 21, 2021
Merged

Add more apis for generic xml security token#4703
HongGit merged 1 commit intodotnet:mainfrom
mconnew:GenericXmlSecurityToken

Conversation

@mconnew
Copy link
Member

@mconnew mconnew commented Aug 30, 2021

Adding api's which are missing from the contract for GenericXmlSecurityToken and GenericXmlSecurityKeyIdentifierClause. This is needed to support the WSTrustChannelFactory usage case where customers will need to access the returned security token's TokenXml property in some cases.

Copy link
Member

@StephenMolloy StephenMolloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about overriding with the same results... but looks fine otherwise.

Comment on lines +246 to +248
public override bool CanCreateKeyIdentifierClause<T>() => default;
public override T CreateKeyIdentifierClause<T>() => default;
public override bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) => default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these overrides just re-defining the same results inherited from SecurityToken?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I think it might do something with regards to what happens when a derived class calls base.MatchesKeyIdentifierClause. When calling a base method, it can't just look up in the vtable for the abstract type and find the method, it's got to look up the method in the actual base class implementation. At least semantically there's a difference. If you didn't know this class also overrode it, you might expect it to call the implementation in the parent class of this. I suspect it would resolve correctly at runtime regardless, but semantically this is more correct.

@HongGit HongGit merged commit 6ffbe1b into dotnet:main Sep 21, 2021
@mconnew mconnew deleted the GenericXmlSecurityToken branch October 11, 2023 17:10
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

Successfully merging this pull request may close these issues.

3 participants