温馨提示:本文翻译自stackoverflow.com,查看原文请点击:docker - 'Provided Authorization Grant is invalid' error while trying to login a dockerized application using
docker wso2 wso2-am wso2carbon wso2is

docker - 尝试使用以下命令登录dockerized应用程序时出现“提供的授权授予无效”错误

发布于 2020-04-28 17:03:17

我已经将一直使用WSO2作为API管理器的Angular应用程序进行了docker化完成配置后,我能够成功运行该应用程序,并能够访问所有现有的api。唯一的问题是当我尝试使用oath2 / token api来执行客户的登录操作时出现的。即使使用相同的代码更早地(在dockerization之前)执行身份验证,也没有任何问题,现在我因为

{
  "error": "invalid_grant",
  "error_description": "Provided Authorization Grant is invalid"
}

用于登录的令牌生成API:

https://<myapplicationurl>:9443/oauth2/token

尝试使用用户名'devtest7@mailinator.com'登录时,docker控制台出现错误:

enter image description here

注意事项:

  • WSO2 AM版本是2.1.0,WSO2 IS版本是5.3.0
  • 请求的参数(标头和参数)与之前使用的参数(用户名和密码除外)相同。
  • 我能够创建一个新用户,并且Carbondb用户列表中列出了相应的用户。
  • 尝试使用现有用户和新创建的用户登录时存在此问题。
  • 我最近为该应用程序生成了新的SSL证书。
  • 只能使用超级管理员登录。使用新创建的电子邮件和用户名登录不起作用。

我尝试了在stackoverflow上看到的解决方案,但并没有解决我的问题。有人可以帮忙吗?

查看更多

提问者
Arun s
被浏览
39
Arun s 2020-02-19 13:09

Thanks for everyone who commented and tried to figure out the solution for the issue i mentioned. I got the resolution for the issue . As i tried multiple times to login by doing permutations and combinations in configurations, authentication was blocked for me. As a reason, i couldn't login and generate access token . I was able to resolve it by changing a flag in identity.xml file inside IS . Changed the UserOperationEventListener enabling from 'true' to 'false' .

Before:

<EventListener enable="true" name="org.wso2.carbon.identity.governance.listener.IdentityMgtEventListener" orderId="95" type="org.wso2.carbon.user.core.listener.UserOperationEventListener"/>

After:

<EventListener enable="false" name="org.wso2.carbon.identity.governance.listener.IdentityMgtEventListener" orderId="95" type="org.wso2.carbon.user.core.listener.UserOperationEventListener"/>

This change allowed me to block the invalid authentication check. We are anyway adding that check from our code side.