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

API use in iFrame #196

Open
Lazarus404 opened this issue Nov 3, 2020 · 1 comment
Open

API use in iFrame #196

Lazarus404 opened this issue Nov 3, 2020 · 1 comment

Comments

@Lazarus404
Copy link

I'm trying to utilise this as part of an API server. The client accessing this is a SPA. Once I've called GET on the NEW endpoint, I open an IFrame and set its URL to the returned url value. However, after redirecting to https://github.com/login?client_id=..., which has a 200 status code, the IFrame shows github.com refused to connect.

Do you have any idea's? I'm not sure what to look for, since the network tab in Chrome shows everything returning correctly.

@danschultzer
Copy link
Collaborator

Iframes should not be permitted for OAuth 2.0 flow: https://tools.ietf.org/html/draft-ietf-oauth-v2-23#section-10.13

I believe Github sets the x-frame-options header to prevent clickjacking. So your only option is to either use the authorization url in the current window, or open a new one.

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

2 participants