Warm tip: This article is reproduced from stackoverflow.com, please click
docker wso2 wso2-am wso2carbon wso2is

'Provided Authorization Grant is invalid' error while trying to login a dockerized application using

发布于 2020-04-23 14:26:48

I have dockerized our Angular application which have been using WSO2 as API manager . After doing the configurations, i was able to run the application successfully and able to hit all existing api's. The only issue arises when i tried to use oath2/token api for performing login operation of our customer . Even though, the same code was used to perform authentication earlier(before dockerization) without any issues,now i am getting error as

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

Token generation api for login :

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

Errors am getting in docker console while trying to login using username 'devtest7@mailinator.com' :

enter image description here

Things to note :

  • WSO2 AM version is 2.1.0 , WSO2 IS version is 5.3.0
  • Arguments(headers & parameters) for the request is the same as that used earlier(except the username and password).
  • I am able to create a new users and the corresponding user is listed in Carbondb users list.
  • The issue exists while trying to login using existing user as well as newly created users.
  • I have recently generated new ssl certificate for the application.
  • Able to login using super admin only . Login using newly created email and username is not working.

I tried solutions seen on stackoverflow which doesn't fixed my issues. Can any one please help?

Questioner
Arun s
Viewed
56
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.