-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
docs: Added Keycloak auth configuration #29487
Conversation
using Flask-OIDC
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.
Is Related to this |
There are often people asking questions about using Keycloak so this is a valuable addition, thank you! Superset uses Flask-AppBuilder for authentication. My first instinct is that anything generic to FAB should go in its security documentation. In fact I see there is a Keycloak section already, I would hate to have anything duplicated between these two places as users will look to both. I'm talking about this: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/docs/security.rst#authentication-oauth Then if there's anything specific to Superset, it should go in the Superset docs. What do you think @lindner-tj ? FYI @dpgaspar works on Preset but he also is the maintainer of FAB, which positions this well to coordinate across the two projects. |
Hi @sfirke, when I was trying to set up SSO with Edit: I understand that custom Security Managers are extensions to FAB, but when you're already providing an example for an |
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.
Thanks @lindner-tj for your comment, I agree upon review it belongs here. I've added minor suggestions and have two questions.
AUTH_USER_REGISTRATION = True | ||
|
||
# The default user self registration role | ||
AUTH_USER_REGISTRATION_ROLE = 'Public' |
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.
Is this required for the OIDC integration to work?
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 haven't tested it without, but you are right, it most likely is not.
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.
Okay. It would be ideal if someone could test, then we could confirm whether this can be removed.
That said, it's not worth holding up the PR merge for.
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 removed the lines and it still works. I can still login via SSO and new users who were never logged-in before get registered. Oddly enough, new users still get assigned the 'Gamma' role. Note: Instead of 'Public' I had set it to AUTH_USER_REGISTRATION_ROLE = 'Gamma'
in my setup.
Co-authored-by: Sam Firke <[email protected]>
Co-authored-by: Sam Firke <[email protected]>
Co-authored-by: Sam Firke <[email protected]>
I'm good with merging this -- though it would be ideal if you could test whether that line about default role is needed -- but also it's failing pre-commit check. Looks like due to trailing whitespace. Can you fix that so it passes CI? |
Would it be possible to post the steps needed to integrate Apache Superset with Keycloak one-by-one? StackOverflow: https://stackoverflow.com/questions/78699787/apache-superset-keycloak-integration |
I removed the whitespace and made a new commit (6261e2b). Sorry for the ambiguous commit message. |
Hi @kormpakis Here is a step-by-step summary of what I did. Mind you I am using Docker compose to run my superset instance.
That's all I did. |
Answering the question of @kormpakis made me aware that I forgot to include this.
thanks for the contribution @lindner-tj ! |
Dear @lindner-tj , One last thing, can you share the needed Keycloak client config? Because when I open Apache Superset, I do get redirected in a Keycloak environment, but this error appears: Invalid parameter: redirect_uri For reference, in my Keycloak client, I have the following: The same redirect uri is also in the client config: I really pray for this to be the final thing to be resolved! :P Thanks a lot again in advance! |
Hi @kormpakis
hope this helps. The endpoint of the redirect_uri needs to match the word before the curly bracket in line 2. |
Hello @lindner-tj , thanks again, a lot, for your kind help. I'm posting my config, so that a clear view is provided. ` OIDC_CLIENT_SECRETS = { OIDC_ID_TOKEN_COOKIE_SECURE = False Also, my Keycloak client's config is as following: For reference, in my Keycloak client, I have the following: Can you recognize any incorrect config that does not allow me to complete the Apache Superset-Keycloak integration? Many thanks in advance and great appreciation for your up-to-now clarifications! |
|
Co-authored-by: Sam Firke <[email protected]>
SUMMARY
Was having issues enabling SSO using Keycloak, got to solution editing what is proposed here: #13806
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
ADDITIONAL INFORMATION