chore(OAuth2): refactor for custom OAuth2 clients (#27880)

This commit is contained in:
Beto Dealmeida
2024-04-05 12:17:39 -04:00
committed by GitHub
parent 62433c14a7
commit 9377227e06
22 changed files with 385 additions and 297 deletions

View File

@@ -1115,9 +1115,13 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
if database is None:
return self.response_404()
oauth2_config = database.get_oauth2_config()
if oauth2_config is None:
raise OAuth2Error("No configuration found for OAuth2")
token_response = database.db_engine_spec.get_oauth2_token(
oauth2_config,
parameters["code"],
state,
)
# delete old tokens