-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Handle scenario where api.base_url is unset for FabAuthManager login #49260
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
Conversation
Resolves apache#49229 Login with FabAuthManager fails when api.base_url is unset. Aligning with implementation with apache#49118
| if g.user is not None and g.user.is_authenticated: | ||
| token = get_auth_manager().generate_jwt(g.user) | ||
| response = make_response(redirect(f"{conf.get('api', 'base_url')}", code=302)) | ||
| response = make_response(redirect(str(request.base_url), code=302)) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
user-provided value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conf.get('api', 'base_url', fallback='/') here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to Pierre's comment
|
|
||
| return response | ||
| return redirect(conf.get("api", "base_url", fallback="/"), code=302) | ||
| return redirect(str(request.base_url), code=302) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
user-provided value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you can remove this I believe
pierrejeambrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that and it didn't work for me.
We can just do conf.get('api', 'base_url', fallback='/') that should be enough, where the fallback is missing. Just tested locally and seems to work
|
Since this is a little bit pressing, considering AF3 timelines I took the liberty to open a PR to fix that with the suggestions #49292 |
I may not have the right setup but I did test this before request.base_url and it didn't work. I just modified the file in the container and restarted it. But if you confirm it works its fine with me |
|
Yes I was able to test with a fresh env, and also confirm that this is also what we are doing in the SimpleAuthManager |
Resolves #49229
Login with FabAuthManager fails when api.base_url is unset. This should fix it
Aligning implementation with #49118 which should resolve the infinite redirect