-
Airflow, Jupyterhub에 Google OAuth 적용하기etc. 2021. 6. 9. 19:18
1. Airflow Configuration
# airflow.cfg [webserver] rbac = True # webserver_config.py ... from flask_appbuilder.security.manager import AUTH_DB, AUTH_OAUTH ... AUTH_TYPE = AUTH_OAUTH AUTH_USER_REGISTRATION = True AUTH_USER_REGISTRATION_ROLE = "User" # --not 'Public' # Google OAuth example: OAUTH_PROVIDERS = [{ 'name':'google', 'token_key':'access_token', 'icon':'fa-google', 'remote_app': { 'api_base_url':'https://www.googleapis.com/oauth2/v2/', 'client_kwargs':{ 'scope': 'email profile' }, 'access_token_url':'https://accounts.google.com/o/oauth2/token', 'authorize_url':'https://accounts.google.com/o/oauth2/auth', 'request_token_url': None, 'client_id': '', 'client_secret' : '', 'redirect_url' : '/oauth-authorized/google' } }]
2. Jupyterhub Configuration
# jupyterhub_config.py from oauthenticator.google import GoogleOAuthenticator c.JupyterHub.authenticator_class = GoogleOAuthenticator c.LocalGoogleOAuthenticator.create_system_users = True c.GoogleOAuthenticator.hosted_domain = [''] c.GoogleOAuthenticator.oauth_callback_url = '/hub/oauth_callback' c.GoogleOAuthenticator.client_id = '' c.GoogleOAuthenticator.client_secret = '' c.Authenticator.add_user_cmd = ['adduser', '-q', '--gecos', '""', '--home', '/home/USERNAME', '--disabled-password']
'etc.' 카테고리의 다른 글
Git 작업을 위한 airflow Dag 관리 (0) 2021.10.09 Github Auth 정책 업데이트 : Personal Access Token 사용하기 (1) 2021.08.16 Jupyterhub - nbviewer 연동하기 (0) 2021.01.19 EC2 -Ubuntu Docker환경에서 jupyterhub 설치하기 (0) 2020.12.25 Synology Docker 기반으로 Hadoop 설치하기 (0) 2020.12.20