[英]WSO2 IS 5.9.0 Updating user claims
我有两个问题,当使用RemoteUserStoreManagerService
SOAP 端点的setUserClaimValue
方法时,更新效果很好。
但是,端点/userinfo
丢失了值,我需要重新验证用户以生成新的访问令牌,并且一切正常。
我需要使用RemoteUserStoreManagerService
setUserClaimValue
方法来更新多个声明,但什么也没发生,我没有任何错误,但声明没有更新。
这是我的环境:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:setUserClaimValues>
<!--Optional:-->
<ser:userName>username@mail.com</ser:userName>
<!--Zero or more repetitions:-->
<ser:claims>
<!--Optional:-->
<xsd:claimURI>http://wso2.org/claims/emailaddress</xsd:claimURI>
<!--Optional:-->
<xsd:value>newemail@mail.com</xsd:value>
</ser:claims>
<!--Optional:-->
<ser:profileName></ser:profileName>
</ser:setUserClaimValues>
</soapenv:Body>
</soapenv:Envelope>
我应该使用什么方法更新多个索赔? 为什么在更新声明时,我的实际访问令牌从 /userinfo 端点丢失了数据,是否需要生成新的访问令牌?
1)
我应该使用什么方法更新多个索赔?
您必须使用来自RemoteUserStoreManagerService
setUserClaimValues
。 您可以按照此文档获取有关此RemoteUserStoreManagerService
更多信息。
下面给出了一个示例肥皂服务。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd">
<soap:Header/>
<soap:Body>
<ser:setUserClaimValues>
<ser:userName>piraveena</ser:userName>
<ser:claims>
<xsd:claimURI>http://wso2.org/claims/organization</xsd:claimURI>
<xsd:value>wso2</xsd:value>
</ser:claims>
<ser:claims>
<xsd:claimURI>http://wso2.org/claims/country</xsd:claimURI>
<xsd:value>srilanka</xsd:value>
</ser:claims>
<ser:profileName>default</ser:profileName>
</ser:setUserClaimValues>
</soap:Body>
</soap:Envelope>
2)
为什么更新声明时,我的实际访问令牌从 /userinfo 端点丢失了数据?
我无法在本地重现此问题。 即使在通过管理服务更新声明后,我也无需重新进行身份验证即可获得用户声明。
当用户声明更新时,映射到访问令牌的用户属性缓存也将被事件清除。 因此,下次调用 useinfo 端点时,缓存将为空。 在这种情况下,将从用户商店获取声明。 请在此处参考此代码。 因此,用户不需要重新进行身份验证,因为用户属性存在于用户存储中。
但是,当您启用电子邮件作为用户名并通过该服务更新用户的电子邮件时,您可能会遇到此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.