I feel like I'm missing something basic here. I found an older thread where someone was seeing 'unauthorized' when attempting to get a token, but the problem there was due to a mismatched redirect_uri, which is not the case here.
My curl command (replacing client secret with <client_secret>):
curl -X POST "https://sandbox.bluebutton.cms.gov/v1/o/token/" -u "Ta0SztVsxBa5HKP5JgkhnVdWrI8mafXfS1l1EdQS:<client_secret>” -d "code=heS4esuPZ8wmlOFUWBifIUVtswSm53&grant_type=authorization_code&redirect_uri=http://localhost:3000"
I get the same response whether I POST via curl, Postman, or through my app (axios):
401 Unauthorized
{
"error": "invalid_grant"
}
The code is initially obtained using the same redirect_uri, which I verified is set correctly in the developer console. This is the URL to get the code:
hi ,I also face the same problem and i tried every thing but still same issue i am facing too.(Status: 401 Unauthorized, Error: {"error": "invalid_grant"} on POST Request to token endpoint).
and i also included a "state" parameter in my initial authorization request that's also not work.kindly help out me.Thanks in advance