You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/29 12:45:10 UTC
[GitHub] [airflow] Bhoomikan opened a new issue #17311: Google Authentication Apache Airflow Issue
Bhoomikan opened a new issue #17311:
URL: https://github.com/apache/airflow/issues/17311
**Apache Airflow version**: 2.0.0b3
**Kubernetes version (if you are using kubernetes)** (use `kubectl version`): NA - LocalExecutor
**Environment**:
- **Cloud provider or hardware configuration**: Local development on Internal IT Cloud Instance
- **OS** (e.g. from /etc/os-release): Redhat-7
- **Others**: Python 3.6
**What happened**:
When trying to register with Google providers having `webserver_config.py` as written here:
```
import os
from flask_appbuilder.security.manager import AUTH_OAUTH
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = "Admin"
AUTH_USER_REGISTRATION_ROLE_JMESPATH = "contains(['GMAIL_ACCOUNT'], email) && 'Admin'
|| 'Public'"
CSRF_ENABLED = True
OAUTH_PROVIDERS = [
{
'name': 'google', 'icon': 'fa-google',
'token_key': 'access_token',
'whitelist': ['@CUSTOM_GMAIL.COM'],
'remote_app': {
'client_id': 'GOOGLE KEY',
'client_secret': 'GOOGLE SECRET',
'api_base_url': 'https://www.googleapis.com/oauth2/v2/',
'client_kwargs': {
'scope': 'email profile'
},
'request_token_url': None,
'access_token_url': 'https://accounts.google.com/o/oauth2/token',
'authorize_url': 'https://accounts.google.com/o/oauth2/auth'}
}
]
```
a `authlib.integrations.base_client.errors.MismatchingStateError: mismatching_state: CSRF
Warning! State not equal in request and response.` error occurred:
```
Something bad has happened.
Please consider letting us know by creating a bug report using GitHub.
Python version: 3.6.9
Airflow version: 2.1.1
Node: or1010051080212.corp.adobe.com
-------------------------------------------------------------------------------
<details>
Traceback (most recent call last):
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/flask_appbuilder/security/views.py", line 695, in oauth_authorized
resp = self.appbuilder.sm.oauth_remotes[provider].authorize_access_token()
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/authlib/integrations/flask_client/remote_app.py", line 74, in authorize_access_token
params = self.retrieve_access_token_params(flask_req, request_token)
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/authlib/integrations/base_client/base_app.py", line 145, in retrieve_access_token_params
params = self._retrieve_oauth2_access_token_params(request, params)
File "/root/airflow_project/airflow-venv/lib64/python3.6/site-packages/authlib/integrations/base_client/base_app.py", line 126, in _retrieve_oauth2_access_token_params
raise MismatchingStateError()
authlib.integrations.base_client.errors.MismatchingStateError: mismatching_state: CSRF Warning! State not equal in request and response.</details>
```
**What you expected to happen**:
It should me register and login
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on issue #17311: Google Authentication Apache Airflow Issue
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #17311:
URL: https://github.com/apache/airflow/issues/17311#issuecomment-889105349
Thanks for opening your first issue here! Be sure to follow the issue template!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #17311: Google Authentication Apache Airflow Issue
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17311:
URL: https://github.com/apache/airflow/issues/17311#issuecomment-889136539
I believe you had a cache from earlier version of Airflow stored locally and you reinstalled Airflow. Just clear the local cache and try again. Alternatively in your setup you have different webserver secret keys, in which case you should specify the webserver secret key manually (depending on your deployment this might be randomly generated but if you have multiple webservers the secret key should be the same in both. Latest Helm Chart relased several days ago has a fix related to that so you might want to upgrade to the latest Official Helm Chart https://airflow.apache.org/docs/helm-chart/stable/index.html if you used earlier version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk closed issue #17311: Google Authentication Apache Airflow Issue
Posted by GitBox <gi...@apache.org>.
potiuk closed issue #17311:
URL: https://github.com/apache/airflow/issues/17311
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org