22# Licensed under the MIT License.
33
44# <UserAuthConfigSnippet>
5+ from azure .identity import DeviceCodeCredential
56from configparser import SectionProxy
67from kiota_authentication_azure .azure_identity_authentication_provider import (
78 AzureIdentityAuthenticationProvider )
1516from msgraph .generated .models .body_type import BodyType
1617from msgraph .generated .models .recipient import Recipient
1718from msgraph .generated .models .email_address import EmailAddress
18- from async_auth import AsyncDeviceCodeCredential
1919
2020class Graph :
2121 settings : SectionProxy
22- device_code_credential : AsyncDeviceCodeCredential
22+ device_code_credential : DeviceCodeCredential
2323 adapter : GraphRequestAdapter
2424 user_client : GraphServiceClient
2525
@@ -29,7 +29,7 @@ def __init__(self, config: SectionProxy):
2929 tenant_id = self .settings ['tenantId' ]
3030 graph_scopes = self .settings ['graphUserScopes' ].split (' ' )
3131
32- self .device_code_credential = AsyncDeviceCodeCredential (client_id , tenant_id = tenant_id )
32+ self .device_code_credential = DeviceCodeCredential (client_id , tenant_id = tenant_id )
3333 auth_provider = AzureIdentityAuthenticationProvider (
3434 self .device_code_credential ,
3535 scopes = graph_scopes )
@@ -40,7 +40,7 @@ def __init__(self, config: SectionProxy):
4040 # <GetUserTokenSnippet>
4141 async def get_user_token (self ):
4242 graph_scopes = self .settings ['graphUserScopes' ]
43- access_token = await self .device_code_credential .get_token (graph_scopes )
43+ access_token = self .device_code_credential .get_token (graph_scopes )
4444 return access_token .token
4545 # </GetUserTokenSnippet>
4646
0 commit comments