Java wso2身份服务器oauth userinfo无角色

Java wso2身份服务器oauth userinfo无角色,java,oauth,oauth-2.0,wso2,wso2is,Java,Oauth,Oauth 2.0,Wso2,Wso2is,我安装了一个WSO2 Identiy服务器,并编写了一些java代码来获取oauth 2的用户信息。为此,我使用OLTU。我已正确连接,在协商access_代码后,我请求userinfo端点,如下所示: https://<serverIP>:9443/oauth2/userinfo?schema=openid 我发现没有返回任何角色信息。我已经创建了一些自定义角色并分配给用户。他们没有任何许可证 我必须在服务器中配置任何东西吗?必须以任何其他方式提出请求?我做错了什么?有两种方法可

我安装了一个WSO2 Identiy服务器,并编写了一些java代码来获取oauth 2的用户信息。为此,我使用OLTU。我已正确连接,在协商access_代码后,我请求userinfo端点,如下所示:

https://<serverIP>:9443/oauth2/userinfo?schema=openid
我发现没有返回任何角色信息。我已经创建了一些自定义角色并分配给用户。他们没有任何许可证

我必须在服务器中配置任何东西吗?必须以任何其他方式提出请求?我做错了什么?

有两种方法可以添加此声明映射。这取决于你的要求

There are two ways to add this claim mapping. It's depends on your requirement.

To get this done has to add a role claim mapping under "http://wso2.org/oidc/claim" claim dialect. This can be done in following ways

Case 1 : For fresh WSO2IS before first startup

Go to <IS_HOME>/repository/conf/claim-config.xml file<br/> Add following configuration under <Dialect dialectURI="http://wso2.org/oidc/claim"><br/> <Claim> <ClaimURI>Roles</ClaimURI> <DisplayName>Roles</DisplayName> <AttributeID>role</AttributeID> <Description>role of the user</Description> <DisplayOrder>10</DisplayOrder> <SupportedByDefault /> </Claim> Case 2: For already running server. Login to the Identity server management console as admin user. Click the Configure button to access the Configure menu Click on http://wso2.org/oidc/claim Dialect. Click on "Add New Claim Mapping" and set the above details. (There you will get an error which is known issues. But that value will store. Then again edit it and set Mapped Attribute again)

Then restart the server. Now you can get user info with roles 要完成此操作,必须在“”声明方言下添加角色声明映射。这可以通过以下方式实现

案例1:首次启动前的新鲜WSO2

转到/repository/conf/claim-config.xml文件 在下面添加以下配置 角色 角色 角色 用户的角色 10 案例2:对于已经运行的服务器。 以管理员用户身份登录到Identity server管理控制台。 单击配置按钮以访问配置菜单 点击方言。 单击“添加新索赔映射”并设置上述详细信息。 (在那里,您将得到一个已知问题的错误。但该值将被存储。然后再次编辑它并再次设置映射属性)

然后重新启动服务器。现在,您可以使用角色获取用户信息

There are two ways to add this claim mapping. It's depends on your requirement.

To get this done has to add a role claim mapping under "http://wso2.org/oidc/claim" claim dialect. This can be done in following ways

Case 1 : For fresh WSO2IS before first startup

Go to <IS_HOME>/repository/conf/claim-config.xml file<br/> Add following configuration under <Dialect dialectURI="http://wso2.org/oidc/claim"><br/> <Claim> <ClaimURI>Roles</ClaimURI> <DisplayName>Roles</DisplayName> <AttributeID>role</AttributeID> <Description>role of the user</Description> <DisplayOrder>10</DisplayOrder> <SupportedByDefault /> </Claim> Case 2: For already running server. Login to the Identity server management console as admin user. Click the Configure button to access the Configure menu Click on http://wso2.org/oidc/claim Dialect. Click on "Add New Claim Mapping" and set the above details. (There you will get an error which is known issues. But that value will store. Then again edit it and set Mapped Attribute again)

Then restart the server. Now you can get user info with roles