Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth2 did not retrieve AccessToken #799

Open
thlcodes opened this issue Sep 27, 2024 · 0 comments
Open

OAuth2 did not retrieve AccessToken #799

thlcodes opened this issue Sep 27, 2024 · 0 comments

Comments

@thlcodes
Copy link

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:
Screenshot 2024-09-27 at 12 46 08

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant