-
Notifications
You must be signed in to change notification settings - Fork 264
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
Authenticating to OIDC server is not redirecting back to the page , but keeps staying on the tab that opens when authorizing. #1196
Comments
Hi, I have never used this particular ouath2 scheme. It seems strange that the window will not close. Extracting the
I think this should be picked up by SwaggeUI. Maybe it is already saved internally, just not used. Have a look at our Also notice that we have a setting for Beware that we also have a interceptor which you are overriding now: https://github.com/tfranzel/drf-spectacular/blob/972141ba71cf3fd3ef37958c3a5f0f38b5d78464/drf_spectacular/templates/drf_spectacular/swagger_ui.js#L100C7-L100C25 We just merged #1191, because we missed reloading the schema after successful oauth2 authentication. However, I think this issue seems one step before that. It is worth a try though. Let me know what works |
Might #1142 be the source of the problem? Apparently the obtained credentials cannot flow back to the origin but are are kind of past that point already. |
Maybe this will fix the problem. When is this going to merge? Should I use drf-spectaculuar-sidecar alone or together with drf-spectacular to get the latest version after the fix is merged? |
you don't need to use I am reviewing #1142 atm Since I cannot rebuild your setup exactly, it would be helpful if you could find out where it hangs for you.
|
I can at least confirm that the bug I'm fixing in #1142 shows the same behavior as described here. The tab opened by Swagger-UI stays open (and blank) while complaining in its javascript console that I don't know anything about addin interceptors to swagger itself though 😅 |
Hello, I tried to extend the view class includeing the header to response. Also removed my template and let drf-spectacular use the default template and it didnt work. Here is my impl:
And the url conf is this one:
I have two url because I have different auth schema for different providers. |
@ftsell in my case the tab stays open but not blank. After authenticating to keycloak it redirects back to my swagger url ( in the same tab ) but as not authenticated. Thats it why i have to use that interceptor. |
@tfranzel Maybe can help, after authenticating to the new tab it redirects back with the token in url: |
Describe the bug
When trying to authorize , UI opens a new tab that redirects to the OIDC server ( in my case keycloak ) . After authenticating to idp the new tab is not closed but stays open and swagger is not authorized. I have to add a interceptor to use that token that is in url of the redirected page.
To Reproduce
heare are my configs:
Expected behavior
I was expecting that when authenticating swagger a new tab opens , and after authenticating to keycloak, this tab closes and i am turned back to the first tab. When turning back to the first tab the pop up of authentication shows that i am authenticated.
The text was updated successfully, but these errors were encountered: