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 authorization code oauth2-redirect.html #115

Open
DeyiXu opened this issue Jun 29, 2020 · 8 comments
Open

oauth2 authorization code oauth2-redirect.html #115

DeyiXu opened this issue Jun 29, 2020 · 8 comments

Comments

@DeyiXu
Copy link

DeyiXu commented Jun 29, 2020

redirect not found

http://localhost:8080/oauth2-redirect.html?code=e9hHdQBGAMIK&state=TW9uIEp1biAyOSAyMDIwIDExOjA1OjM4IEdNVCswODAwICjkuK3lm73moIflh4bml7bpl7Qp

redirect ok

http://localhost:8080/swagger/oauth2-redirect.html?code=e9hHdQBGAMIK&state=TW9uIEp1biAyOSAyMDIwIDExOjA1OjM4IEdNVCswODAwICjkuK3lm73moIflh4bml7bpl7Qp

Unable to configure

@DeyiXu
Copy link
Author

DeyiXu commented Jun 29, 2020

Related PR: #92

@alvarogf97
Copy link
Contributor

Hi, what happens with this issue? I cannot configure the redirect_uri :(

@DeyiXu
Copy link
Author

DeyiXu commented Nov 2, 2021

The difference between http://localhost:8080/oauth2-redirect.html and http://localhost:8080/swagger/oauth2-redirect.html

Here's how I solved it:
https://github.com/nilorg/naas/blob/92e3cff2a821fb82797a875d8e0111e7a6d9360e/internal/pkg/gin-swagger/swagger.go

https://github.com/nilorg/naas/blob/92e3cff2a821fb82797a875d8e0111e7a6d9360e/internal/pkg/gin-swagger/swagger.go#L237

Issues related:
swaggo/swag#595
#92

@alvarogf97
Copy link
Contributor

So, is it necessary to rewrite internal package code?

@DeyiXu
Copy link
Author

DeyiXu commented Nov 2, 2021

Other authors' pull request was not applied.

I referred to their code and made changes myself. It would solve my problem at the time

Google Translate

@ubogdan
Copy link
Contributor

ubogdan commented Nov 2, 2021

@DeyiXu, the PR has a merge conflict, and the author didn't respond on time. A PR regarding this matter is always welcome, and I will be more than happy to assist you with a CR.
On the other side, rendering the Oauh2 appID and AppSecret on the HTML is not secure, but I assume this would be only for testing purposes.

@alvarogf97
Copy link
Contributor

I think his idea is to request the redirect_uri param on the authorization form. Have you got another idea about how to render the oauth2-redirect.html into the designed path in gin?

@ubogdan
Copy link
Contributor

ubogdan commented Nov 3, 2021

@alvarogf97, any contribution is welcome. Unfortunately, I don't have enough spare time to work on this, but it will be a pleasure to assist you with a code review.

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

3 participants