Kentor AuthService - 读取主题名称ID [英] Kentor AuthService - Read Subject NameID

查看:61
本文介绍了Kentor AuthService - 读取主题名称ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Kentor AuthService 从 saml2:Subject 响应 XML 节点访问 saml2:NameID?

How can I access to saml2:NameID from saml2:Subject response XML node by using Kentor AuthService?

我在代码中找不到任何处理 XML 部分的内容.也许我错过了什么.

I couldn't find in code anything that deals with that part of XML. Maybe I'm missing something.

我不是在问 Kentor IdP,我看到 NameID 是作为附加声明发送的,它被翻译为属性,我问的是一般而言,IdP 不必由 Kentor 提供支持,所以我可以't 相信我会将这个值作为属性传递.

I'm not asking about Kentor IdP, I see that there NameID is sent as additional claim, which is translated as attribute, I'm asking in general, IdP does not have to be powered by Kentor, so I can't rely that I will have this value passed as attribute.

所以,如果它被处理了,我在这里找不到它:https://github.com/KentorIT/authservices/tree/master/Kentor.AuthServices

So, if it's handled I couldn't find it here: https://github.com/KentorIT/authservices/tree/master/Kentor.AuthServices

一种选择是自己解析 XML,但如果已经实施或更好的解决方案会很棒.

One option can be to parse XML on my own, but if there's already implemented or better solution that will be great.

推荐答案

Subject NameID 被转换为类型为 ClaimTypes.NameIdentifier (http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier).

The Subject NameID is translated to a claim with type ClaimTypes.NameIdentifier (http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier).

它应该在创建的声明标识的声明集合中.

It should be in the claims collection of the created claims identity.

这篇关于Kentor AuthService - 读取主题名称ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆