繁体   English   中英

wso2 身份服务器:Oauth 2.0 自定义授权不适用于 5.11

[英]wso2 identity server: Oauth 2.0 custom grant is not working for 5.11

创建自定义 Oauth 2.0 授权适用于 wso2is 5.9(检查以下 wso2is 教程),但不适用于 wso2is 5.11。在配置新服务期间,我无法在允许的授权下查看新授权(我将其命名为“accessToken”)提供者(检查屏幕截图)。

为什么自定义授权不适用于 wso2is 5.11? 请支持。

教程与 5.7 兼容,适用于 5.9:

https://docs.wso2.com/display/IS570/Writinn;tg+a+Custom+OAuth+2.0+Grant+Type

1-自定义授权 JAr 位置:wso2is-5.11\repository\components\lib\custom-grant-1.0.0.jar

2- xml 标签添加到 /repository/conf/identity/identity.xml

<SupportedGrantType> <GrantTypeName>accesstoken</GrantTypeName> <IdTokenAllowed>true</IdTokenAllowed> <GrantTypeHandlerImplClass>org.wso2.sample.identity.oauth2.grant.mobile.MobileGrant</GrantTypeHandlerImplClass> <GrantTypeValidatorImplClass>org.wso2.sample.identity.oauth2.grant.mobile.MobileGrantValidator</GrantTypeValidatorImplClass> </SupportedGrantType>

在此处输入图像描述

Adding the mentioned XML tags to <IS-HOME>/repository/conf/identity/identity.xml won't work in IS-5.11.0 as it relies on new configuration model https://is.docs.wso2.com/ en/5.11.0/references/new-configuration-model/

如果您手动更改了 identity.xml 文件,一旦服务器重新启动,这些配置应该已经重置为默认值。 在 SP oauth 配置下应该不显示新的授权类型。

所以你必须改变deployment.toml文件如下

[[oauth.custom_grant_type]]
name="accesstoken"
grant_handler="org.wso2.sample.identity.oauth2.grant.mobile.MobileGrant"
grant_validator="org.wso2.sample.identity.oauth2.grant.mobile.MobileGrantValidator"
[oauth.custom_grant_type.properties]
IdTokenAllowed=true

参考: https://is.docs.wso2.com/en/5.11.0/learn/writing-a-custom-oauth-2.0-grant-type/#resources

注意:始终参考使用的产品版本文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM