mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-22 22:11:03 +02:00
do teams too
This commit is contained in:
parent
1308b6cbe8
commit
1502bcea12
@ -186,17 +186,21 @@ class TeamsConnector(LoadConnector, PollConnector):
|
|||||||
teams_client_secret = credentials["teams_client_secret"]
|
teams_client_secret = credentials["teams_client_secret"]
|
||||||
teams_directory_id = credentials["teams_directory_id"]
|
teams_directory_id = credentials["teams_directory_id"]
|
||||||
|
|
||||||
def _acquire_token_func() -> dict[str, Any]:
|
|
||||||
"""
|
|
||||||
Acquire token via MSAL
|
|
||||||
"""
|
|
||||||
authority_url = f"https://login.microsoftonline.com/{teams_directory_id}"
|
authority_url = f"https://login.microsoftonline.com/{teams_directory_id}"
|
||||||
app = msal.ConfidentialClientApplication(
|
self.msal_app = msal.ConfidentialClientApplication(
|
||||||
authority=authority_url,
|
authority=authority_url,
|
||||||
client_id=teams_client_id,
|
client_id=teams_client_id,
|
||||||
client_credential=teams_client_secret,
|
client_credential=teams_client_secret,
|
||||||
)
|
)
|
||||||
token = app.acquire_token_for_client(
|
|
||||||
|
def _acquire_token_func() -> dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Acquire token via MSAL
|
||||||
|
"""
|
||||||
|
if self.msal_app is None:
|
||||||
|
raise RuntimeError("MSAL app is not initialized")
|
||||||
|
|
||||||
|
token = self.msal_app.acquire_token_for_client(
|
||||||
scopes=["https://graph.microsoft.com/.default"]
|
scopes=["https://graph.microsoft.com/.default"]
|
||||||
)
|
)
|
||||||
return token
|
return token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user