identity = client.create_user () < /p>
< /blockquote>
Ich erhalte 403 -Fehler.
Code: Select all
from datetime import timedelta
from azure.communication.identity import CommunicationIdentityClient
connection_string = "Endpoint=https://signalrpro.service.signalr.net;AccessKey=acc;Version=1.0;"
client = CommunicationIdentityClient.from_connection_string(connection_string)
identity = client.create_user()
print("\nCreated an identity with ID: " + identity.properties['id'])
# Issue an access token with a validity of 24 hours and the "voip" scope for an identity
# Issue an access token with a validity of an hour and the "voip" scope for an identity
token_expires_in = timedelta(hours=1)
token_result = client.get_token(identity, ["voip"], token_expires_in=token_expires_in)
#token_result = client.get_token(identity, ["voip"])
print("\nIssued an access token with 'voip' scope that expires at " + token_result.expires_on + ":")
print(token_result.token)