Skip to content

Commit

Permalink
fx: fix access token injection for external user
Browse files Browse the repository at this point in the history
Signed-off-by: ImMin5 <mino@megazone.com>
  • Loading branch information
ImMin5 committed Dec 30, 2023
1 parent eb08c9a commit 38bf7a1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ def __init__(self, *args, **kwargs):
self.user_mgr = UserManager()

def authenticate(self, domain_id: str, **kwargs):
user_id = kwargs.get("user_id")
credentials = kwargs.get("credentials", {})
user_id = kwargs.get("user_id")
access_token = kwargs.get("access_token")

_LOGGER.debug(f"[authenticate] domain_id: {domain_id}")

# Add User ID for External Authentication
if user_id:
credentials["user_id"] = user_id

if access_token:
credentials["access_token"] = access_token

self.domain: Domain = self.domain_mgr.get_domain(domain_id)

self._check_domain_state()
Expand All @@ -55,7 +59,7 @@ def authenticate(self, domain_id: str, **kwargs):
f'[authenticate] Authentication success. (user_id={external_auth_user_info.get("user_id")})'
)

auto_user_sync = self.external_auth.plugin_info.options.get(
auto_user_sync = self.external_auth.plugin_info.get("options", {}).get(
"auto_user_sync", False
)

Expand Down

0 comments on commit 38bf7a1

Please sign in to comment.