dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.63k stars 1.35k forks source link

feat: support Auth0 OAuth2 #2171

Closed dpgaspar closed 9 months ago

dpgaspar commented 9 months ago

Description

Supports Auth0 OAuth provider

Advised config:

OAUTH_PROVIDERS = [
    {
        "name": "auth0",
        "icon": "fa-shield-halved",
        "token_key": "access_token",
        "remote_app": {
            "client_id": os.environ.get("AUTH0_KEY"),
            "client_secret": os.environ.get("AUTH0_SECRET"),
            "api_base_url": f"https://{os.environ.get('AUTH0_DOMAIN')}/oauth2/v1/",
            "client_kwargs": {"scope": "openid profile email groups"},
            "access_token_url": f"https://{os.environ.get('AUTH0_DOMAIN')}/oauth/token",
            "authorize_url": f"https://{os.environ.get('AUTH0_DOMAIN')}/authorize",
            "server_metadata_url": f"https://{os.environ.get('AUTH0_DOMAIN')}/"
                                   f".well-known/openid-configuration",
        },
    }
]

ADDITIONAL INFORMATION

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ba63c5c) 79.30% compared to head (6036c23) 79.31%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2171 +/- ## ======================================= Coverage 79.30% 79.31% ======================================= Files 72 72 Lines 8970 8974 +4 ======================================= + Hits 7114 7118 +4 Misses 1856 1856 ``` | [Flag](https://app.codecov.io/gh/dpgaspar/Flask-AppBuilder/pull/2171/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar) | Coverage Δ | | |---|---|---| | [python](https://app.codecov.io/gh/dpgaspar/Flask-AppBuilder/pull/2171/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar) | `79.31% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniel+Vaz+Gaspar#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.