aurokk commented on code in PR #38469:
URL: https://github.com/apache/superset/pull/38469#discussion_r3009412813
##########
superset/models/core.py:
##########
@@ -509,20 +509,30 @@ def _get_sqla_engine( # pylint: disable=too-many-locals
# noqa: C901
if user and user.email:
effective_username = user.email.split("@")[0]
- oauth2_config = self.get_oauth2_config()
- access_token = (
- get_oauth2_access_token(
- oauth2_config,
- self.id,
- g.user.id,
- self.db_engine_spec,
- )
- if oauth2_config and hasattr(g, "user") and hasattr(g.user, "id")
- else None
- )
masked_url = self.get_password_masked_url(sqlalchemy_url)
logger.debug("Database._get_sqla_engine(). Masked URL: %s",
str(masked_url))
+ # Check if this database has an upstream login provider configured.
+ # If so, use the saved login token instead of a separate database
OAuth2 dance.
Review Comment:
if config_exists() && token_exists():
reuse_superset_token()
else:
old_way()
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]