首页 文章

如何定义OIDC / userinfo请求的用户声明列表

提问于
浏览
2

我有一个在WSO2 Identity Server 5.0.0中运行的自定义UserStoreManager作为辅助用户存储 . 它非常适合用户身份验证 . 将其与OpenID Connect身份验证一起使用时,预期的声明不会在 /userinfo?schema=openid 请求的响应中返回给客户端 . 登录自定义UserStoreManager会显示使用以下声明名称调用getUserPropertyValues()方法:

["postalcode", "mail", "localityName", "sn", "cn", "nickName", "telephoneNumber", "gender", "givenName", "url", "country"]

/userinfo 请求的响应实际上仅返回该列表中的声明 . 无法获得其他索赔 .

我不明白的是这个列表的来源 . 配置的声明映射为“http://wso2.org/oidc/claim " defines for example " postalcode " as "默认支持= false " and "必需= false ". So I don't expect it to be in the list. On the other hand claim " sub " (or the name it is mapped to: " uid ") is not in the list, but its definition in dialect " http://wso2.org/oidc/claim”是

  • 索赔Uri:sub

  • Mapped Attribute(s):uid

  • 默认支持:true

  • 必填: true

此外"sub"是OIDC Spec定义的必要声明(见http://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse) .

在哪里可以定义应该由/ userinfo?schema = openid请求为成功通过身份验证的用户返回的声明列表?

1 回答

  • 0

    调用userinfo endpoints ,我们获得http://wso2.com/oidc/claim dialect下列出的声明的用户属性值 .

    在声明配置中,我们在用户存储中声明了uri和特定属性(辅助用户存储的主要和默认值) . 例如:http://wso2.org/oidc/claim/sub,其映射属性为uid

    如果辅助用户存储不支持此默认属性值,则必须在映射属性下对其进行配置 . 例如:

    secondary user store domain = SECONDARY_
     supported attribute value fore sub = subject
     Configuration for mapped attribute = uid;SECONDARY_/subject
    

    现在,您将获得getUserPropertyValues()方法的正确属性值列表 .

    以下配置用于管理控制台配置文件管理

    Default支持默认值= true在管理控制台中,默认情况下可以编辑此属性必需= true更新用户配置文件时必须归档此属性 .

相关问题