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-redirect and email links #6150

Open
bolso opened this issue Jun 16, 2020 · 0 comments · May be fixed by #9248
Open

oauth2-redirect and email links #6150

bolso opened this issue Jun 16, 2020 · 0 comments · May be fixed by #9248

Comments

@bolso
Copy link

bolso commented Jun 16, 2020

Is your feature request related to a problem?

The oauth2-redirect page (https://github.com/swagger-api/swagger-ui/blob/master/dev-helpers/oauth2-redirect.html) is looking for the originator of the oauth2 flow using window.opener. If we authorize the user through a link to this page provided in an email, the page will not find an opener and crash with

Uncaught TypeError: Cannot read property 'swaggerUIRedirectOauth2' of null
    at run (o2c.html:9)
    at onload (VM9 o2c.html:3)

Describe the solution you'd like

The callback page could fallback to rendering the swagger ui with the provided credentials if no opener can be found.

This does come at the expense of spawning new tabs and not being able to compare the sent payload with the one received from the server.

If there is a recommended way for generating callback links to include in emails I'd be interested to know more.

Describe alternatives you've considered

None. Allowing the swagger ui to accept a provided jwt might work as we can always get it from the callback link.

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

Successfully merging a pull request may close this issue.

2 participants