본문 바로가기
공부/Open Source

[superset/helm] Google OAuth 붙이기

by haejang 2023. 11. 5.
728x90
728x90

 

https://artifacthub.io/packages/helm/superset/superset

 

superset 0.10.14 · superset/superset

Apache Superset is a modern, enterprise-ready business intelligence web application

artifacthub.io

 

 

 

# 1. Google OAuth 2.0 Client 만들기

  • 승인된 자바스크립트 원본 : Superset 도메인
  • 승인된 리디렉션 URI : Superset 도메인 + /oauth-authorized/google

 

 

# 2. superset helm value 추가

configOverrides:
  enable_oauth: |
    from flask_appbuilder.security.manager import (AUTH_DB, AUTH_OAUTH)
    AUTH_TYPE = AUTH_OAUTH
    OAUTH_PROVIDERS = [
        {
            "name": "google",
            "whitelist": [''], # 승인할 google 도메인. ex) '@honglab.co.kr'
            "icon": "fa-google",
            "token_key": "access_token",
            "remote_app": {
                "client_id": "", # Google Client ID
                "client_secret": "", # Google Client 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",
                "authorize_params": {"hd": os.getenv("OAUTH_HOME_DOMAIN", "")}
            }
        }
    ]
    # Map Authlib roles to superset roles
    AUTH_ROLE_ADMIN = 'Admin'
    AUTH_ROLE_PUBLIC = 'Public'
    # Will allow user self registration, allowing to create Flask users from Authorized User
    AUTH_USER_REGISTRATION = True
    # The default user self registration role
    AUTH_USER_REGISTRATION_ROLE = "Admin"
    WEBDRIVER_BASEURL_USER_FRIENDLY = "" # Superset 도메인. ex) "https://superset.honglab.co.kr"

 

 

 

 

728x90
728x90

댓글