diff --git a/docs/quickcharts.rst b/docs/quickcharts.rst index bc35f0aa47..8ce3135bd1 100644 --- a/docs/quickcharts.rst +++ b/docs/quickcharts.rst @@ -17,7 +17,7 @@ Direct Data Charts These charts can display multiple series, based on columns or methods defined on models. You can display multiple charts on the same view. -Let's create a simple model first, the gold is to display a chart showing the unemployment evolution +Let's create a simple model first, the goal is to display a chart showing the unemployment evolution versus the percentage of the population with higher education, our model will be:: class CountryStats(Model): @@ -126,7 +126,7 @@ You can display multiple charts on the same view. This data can be grouped and a Let's create some simple models first, base on the prior example but this time lets make our models support has many countries has we like. -The gold is to display a chart showing the unemployment +The goal is to display a chart showing the unemployment versus the percentage of the population with higher education per country:: from flask_appbuilder import Model diff --git a/flask_appbuilder/security/manager.py b/flask_appbuilder/security/manager.py index e30ad7410e..a25b63ae72 100644 --- a/flask_appbuilder/security/manager.py +++ b/flask_appbuilder/security/manager.py @@ -660,13 +660,17 @@ def get_oauth_user_info( me = self.appbuilder.sm.oauth_remotes[provider].get("userinfo") data = me.json() log.debug("User info from Okta: %s", data) - return { - "username": f"{provider}_{data['sub']}", - "first_name": data.get("given_name", ""), - "last_name": data.get("family_name", ""), - "email": data["email"], - "role_keys": data.get("groups", []), - } + if "error" not in data: + return { + "username": f"{provider}_{data['sub']}", + "first_name": data.get("given_name", ""), + "last_name": data.get("family_name", ""), + "email": data["email"], + "role_keys": data.get("groups", []), + } + else: + log.error(data.get("error_description")) + return {} # for Auth0 if provider == "auth0": data = self.appbuilder.sm.oauth_remotes[provider].userinfo()