gin-server icon indicating copy to clipboard operation
gin-server copied to clipboard

How to use the password grant?

Open adhikari-suman opened this issue 2 years ago • 2 comments

I am trying to use the password grant to login the user. The API hosts both oauth2 server and resource api in same backend api.

When I send the POST request to /token, I get the below response. I am using the default example that is provided for now but I'm using the password grant instead of client_credentials grant.

{
    "error": "access_denied",
    "error_description": "The resource owner or authorization server denied the request"
}

Screen Shot 2022-05-30 at 00 01 49

adhikari-suman avatar May 29 '22 18:05 adhikari-suman

have you used SetPasswordAuthorizationHandler?

jarlandre avatar Jan 18 '23 13:01 jarlandre

I'm having the same issue. I was able to get a token, but only by providing both the username=test&password=test url params as well as the Authorization: Basic header. What's even stranger, is the two didn't even need to match!

jhoffmann avatar Apr 25 '24 09:04 jhoffmann