-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Custom OAuth issue #7739
Comments
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details. |
I have the same issue after upgrading to 0.28.1, please help |
Same here, also 0.28.1. Also please help :) Sorry, something went wrong |
I'm facing same issue after updating my superset (last version was from more than a month ago) I'm getting 'login' KeyError. |
OAuth is working properly on v0.33.0rc1. Have you tried? |
Juste tried 0.34 rc : facing the same issue. |
Note : I did a quick and really dirty as I'm running all this in a docker container. around line 677
Does the job until something better fixes it. |
I'm seeing this too on 0.33.0rc1. I did a little digging today and found this PR dpgaspar/Flask-AppBuilder#910 which introduced redirects after login. I noticed that the Clicking on login, then redirects to If I logout and go back to the login screen and then manually set the ...then I can login successfully. Not sure if this is a |
If the next value is empty then the next_url is also set to an empty string which breaks redirection (currently reproducible in the latest version of Superset) See apache/superset#7739
If the next value is empty then the next_url is also set to an empty string which breaks redirection (currently reproducible in the latest version of Superset) See apache/superset#7739
To pick up this fix dpgaspar/Flask-AppBuilder#1095 which addresses apache#7739
* Bump flask-appbuilder to 2.1.12 To pick up this fix dpgaspar/Flask-AppBuilder#1095 which addresses #7739 * Bump FAB again to 2.1.13
I've seen a few comments here suggesting the fix didn't work for them. I don't see them any longer so hopefully they were just config/setup problems. It would great if anyone could give this a comment a 👍 or just add a comment if they've confirmed the issue is now resolved. Thanks! |
I deleted my comment because I was able to get it working. It seems like the change added a new issue of re-directing |
I'm getting the same error, using c566141 Sorry, something went wrong #Gitlab oauth2 configuration.
from flask_appbuilder.security.manager import AUTH_OAUTH
from custom_sso_security_manager import CustomSsoSecurityManager
CUSTOM_SECURITY_MANAGER = CustomSsoSecurityManager
CSRF_ENABLED = True
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = 'Public'
OAUTH_PROVIDERS = [{
'name': 'gitlab',
'icon': 'fa-gitlab',
'token_key': get_env_variable('GITLAB_TOKEN_KEY'),
'remote_app': {
'base_url': 'https://gitlab.com/api/v4/user',
'request_token_params': {
'scope': 'openid read_user'
},
'access_token_url': 'https://gitlab.com/oauth/token',
'authorize_url': 'https://gitlab.com/oauth/authorize',
'request_token_method': 'GET',
'access_token_method': 'POST',
'consumer_key': get_env_variable('GITLAB_CONSUMER_KEY'),
'consumer_secret': get_env_variable('GITLAB_CONSUMER_SECRET')
}
}] Not 100% sure about this custom oauth user info with regard to gitlab: from superset.security import SupersetSecurityManager
class CustomSsoSecurityManager(SupersetSecurityManager):
def oauth_user_info(self, provider, response=None):
logging.debug("Oauth2 provider: {0}.".format(provider))
if provider == 'gitlab':
# As example, this line request a GET to base_url + '/' + userDetails with Bearer Authentication,
# and expects that authorization server checks the token, and response with user details
me = self.appbuilder.sm.oauth_remotes[provider].get('userDetails').data
logging.debug("user_data: {0}".format(me))
return { 'name' : me['name'], 'email' : me['email'], 'id' : me['user_name'], 'username' : me['user_name'], 'first_name':'', 'last_name':''} |
This issue seems to still exist. Just upgraded from 0.28.1 to 0.34.0.
The most relevant part of
|
Just to be clear, the fix wasn't in the 0.34 release so you'll have to wait for the next release or deploy the latest source. |
We're running it from latest master and issue still persists... |
Hi just made a simple test on flask-appbuilder with google oauth and it worked fine, I would say that this is more of a flask-appbuilder question/issue so feel free to open an issue there. The above error seems more of a configuration issue setting your google oauth credentials |
Could you share with us your working configuration? Thanks |
* Bump flask-appbuilder to 2.1.12 To pick up this fix dpgaspar/Flask-AppBuilder#1095 which addresses #7739 * Bump FAB again to 2.1.13
Yeah, I know how it looks, but my Google OAuth config worked just fine with PyPI release 0.29.0rc7... |
@tomklapka, https://github.com/dpgaspar/Flask-AppBuilder/blob/master/examples/oauth/config.py#L42 I've removed the twitter and azure definitions and exported google OAuth secrets to the required env vars. One more this is a flask-appbuilder issue/question, feel free to open an issue over there |
Same fix as was required for Superset (apache/superset#7739)
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) (cherry picked from commit 47facb405485895694917d8ae407b925a57624b8) GitOrigin-RevId: a4f7ef12ca54d0e537e3d438aee3a68f76b7aebb
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
I am unable to log in to Apache Superset using Microsoft Azure AD. Here is my configuration. I am also able to see the Microsoft login page, but when I submit the button, Superset throws an error: 'Invalid login. Please try again
|
* Bump flask-appbuilder to 2.1.12 To pick up this fix dpgaspar/Flask-AppBuilder#1095 which addresses apache/superset#7739 * Bump FAB again to 2.1.13
* Bump flask-appbuilder to 2.1.12 To pick up this fix dpgaspar/Flask-AppBuilder#1095 which addresses apache#7739 * Bump FAB again to 2.1.13
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
This might also fix AIRFLOW-5462 (OAuth login issue) Same fix as was required for Superset (apache/superset#7739) GitOrigin-RevId: 47facb405485895694917d8ae407b925a57624b8
A clear and concise description of what the bug is.
hi, i configure my oauth login according to http://superset.apache.org/installation.html#custom-oauth2-configuration. Everything is right, but it turns wrong when the code runs at "oauth_authorized" method in views.py. The problem is all the args in functions "redirect" may be wrong, such as "redirect("login")", "redirect(next_url)". I think it would be "redirect(self.appbuilder.get_url_for_login)". And another question is the value of "nex_url" which is empty, and the correct value maybe "/superset/welcome". Would you please help me to solve this problem? Thank you.
Expected results
When success, rediect to "/superset/welcome".Otherwise, redirect to "self.appbuilder.get_url_for_login".
what you expected to happen.
Actual results
When success/failed, rediect to "/oauth-authorized/login"
what actually happens.
Environment
(please complete the following information):
Superset 0.999.0dev
3.6.6
How to reproduce the bug
click oauth login
Checklist
Make sure these boxes are checked before submitting your issue - thank you!
Additional context
Add any other context about the problem here.
2019-06-20 10:00:39,487:INFO:werkzeug:127.0.0.1 - - [20/Jun/2019 10:00:39] "GET /oauth-authorized/login HTTP/1.1" 500 -
Traceback (most recent call last):
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 2328, in call
return self.wsgi_app(environ, start_response)
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 2314, in wsgi_app
response = self.handle_exception(e)
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1760, in handle_exception
reraise(exc_type, exc_value, tb)
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/_compat.py", line 36, in reraise
raise value
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 2311, in wsgi_app
response = self.full_dispatch_request()
File "src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1834, in full_dispatch_request
rv = self.handle_user_exception(e)
File "src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1737, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/_compat.py", line 36, in reraise
raise value
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1832, in full_dispatch_request
rv = self.dispatch_request()
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask/app.py", line 1818, in dispatch_request
return self.view_functionsrule.endpoint
File "/src/superset/superset/venv/lib/python3.6/site-packages/flask_appbuilder/security/views.py", line 677, in oauth_authorized
resp = self.appbuilder.sm.oauth_remotes[provider].authorized_response()
KeyError: 'login'
The text was updated successfully, but these errors were encountered: