swagger-ui-watcher icon indicating copy to clipboard operation
swagger-ui-watcher copied to clipboard

oauth2-redirect.html missing

Open n2ygk opened this issue 5 years ago • 6 comments

I believe updating dependency to swagger-editor dist 3.6.26 fixes this.

A newer release of swagger-editor dist apparently adds https://github.com/swagger-api/swagger-ui/tree/v3.22.0 which includes the missing oauth2-redirect.html which causes an oauth2 authorization to otherwise fail with a 404 when redirecting back to the redirect_uri.

PS: Thanks for this cool tool!

n2ygk avatar Mar 26 '19 15:03 n2ygk

Hi Alax,

I will look into this.

Thank you!

On Tue, Mar 26, 2019 at 8:52 AM Alan Crosswell [email protected] wrote:

I believe updating dependency to swagger-editor dist 3.6.26 fixes this.

A newer release of swagger-editor dist apparently adds https://github.com/swagger-api/swagger-ui/tree/v3.22.0 which includes the missing oauth2-redirect.html https://github.com/swagger-api/swagger-ui/commits/v3.22.0/dist/oauth2-redirect.html which causes an oauth2 authorization to otherwise fail with a 404 when redirecting back to the redirect_uri.

PS: Thanks for this cool tool!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/moon0326/swagger-ui-watcher/issues/31, or mute the thread https://github.com/notifications/unsubscribe-auth/AEgRyWpPng8FOuClJ7avAIGMjxgePUonks5vakJbgaJpZM4cLzze .

-- http://leafgroup.com

Moon Kyong Lead Software Engineer

310-917-6400 ext6688

[email protected]

1655 26th Street CA 90404 leafgroup.com

-- Please NOTE: This electronic message, including any attachments, may include privileged, confidential and/or inside information owned by Leaf Group. Any distribution or use of this communication by anyone other than the intended recipient(s) is strictly prohibited and may be unlawful. If you are not the intended recipient, please notify the sender by replying to this message and then delete it from your system. Thank you.

moon0326 avatar Mar 26 '19 16:03 moon0326

I tried forking this and changing the dependency to 3.6.22 but it seems the redirect_uri is still not found.

n2ygk avatar Mar 26 '19 16:03 n2ygk

See https://github.com/swagger-api/swagger-editor/issues/1969

n2ygk avatar Mar 26 '19 17:03 n2ygk

My workaround is to cp oauth2-redirect.html /usr/local/lib/node_modules/swagger-ui-watcher/node_modules/swagger-editor-dist/

n2ygk avatar Mar 26 '19 18:03 n2ygk

Sorry for the delay in response. I think we can include swagger-ui: 3.22.0 as a dependency then add a new route in index.js (line #63)

 app.get('/oauth2-redirect.html', function(req, res) {
    res.sendFile(__dirname + "/node_modules/swagger-ui/dist/oauth2-redirect.html");
 });

This should get the content of oauth2-redirect.html from the official swagger-ui package and response to http://localhost:{port}/oauth2-redirect.html.

You're welcome to make PR or I can also make a PR myself.

moon0326 avatar Mar 30 '19 11:03 moon0326

I may have missed it, but updating the documentation to include the redirect path would allow users to register their client with their Oauth2 provider more easily.

the-code-robot avatar Jul 17 '19 17:07 the-code-robot