Skip to content

Commit

Permalink
Fix open-metadata#2984: added azure sso auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ulixius9 committed Feb 28, 2022
1 parent a111429 commit ec30b7f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ingestion/src/metadata/ingestion/ometa/openmetadata_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,16 @@ def auth_token(self) -> str:
client_credential=self.config.secret_key,
authority=self.config.authority,
)
result = app.acquire_token_for_client(scopes=self.config.scopes)
token = app.acquire_token_for_client(scopes=self.config.scopes)
try:
return result["access_token"]
self.generated_auth_token = token["access_token"]
self.expiry = token["expires_in"]

except KeyError as err:
logger.error(f"Invalid Credentials - {err}")
logger.debug(traceback.format_exc())
logger.debug(traceback.print_exc())
sys.exit(1)
def get_access_token(self):
self.auth_token()
return (self.generated_auth_token, self.expiry)

0 comments on commit ec30b7f

Please sign in to comment.