httpyac
httpyac copied to clipboard
OAuth2 did not retrieve AccessToken
Hi!
First things first: great tool & VSCode extension, really enjoying it!
I only have one issue:
When trying to make openid auth work:
# @name authtest
@authtest_clientId=XXX
@authtest_tokenEndpoint=https://xxx.hana.ondemand.com/oauth2/api/v1/token
@authtest_authorizationEndpoint=https://xxx.hana.ondemand.com/oauth2/api/v1/authorize
GET /whatever
Authorization: openid authorization_code authtest
The authorization code is successfully forwarded to the httpyac auth server (looks like this: http://localhost:3000/?code=zGPZ7MZ9cJWsDebsncdZwB9qqXi&state=WoAkxmIPj6qGVqmSVJjb7Ir5Cv5), but then nothing happens:
I do not see any logs to why this happens.
When I copy the auth code and call the token request manually it works just fine and I get a response with access_token, refresh_token etc.:
# @name login
# @description 2 login with auth code
@code={{ $input code }}
POST /oauth2/api/v1/token
Content-Type: application/x-www-form-urlencoded
client_id=XXX
&redirect_uri=http://localhost:3000
&code={{code}}
&grant_type=authorization_code
I also tried interception, but this is not even called:
{{
exports.authtest_interceptRequest = function(request, context) {
debugger;
console.log(request, context)
}
}}
Any idea? Am I missing something?
Cheers Thomas