Skip to content

Commit d212e45

Browse files
authored
Fix 'str' object has no attribute 'properties' error
Original code failed to revoke or delete identity by passing the 'id' instead of the identity object, resulting in an exception.
1 parent d75b825 commit d212e45

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

articles/communication-services/quickstarts/includes/user-access-token-python.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: tomaschladek
66
manager: nmurav
77
ms.service: azure-communication-services
88
ms.subservice: azure-communication-services
9-
ms.date: 06/30/2021
9+
ms.date: 09/12/2021
1010
ms.topic: include
1111
ms.custom: include file
1212
ms.author: tchladek
@@ -127,17 +127,17 @@ token_result = client.get_token( identity, ["voip"])
127127
In some cases, you may explicitly revoke access tokens. For example, when an application's user changes the password they use to authenticate to your service. Method `revoke_tokens` invalidates all active access tokens, that were issued to the identity.
128128

129129
```python
130-
client.revoke_tokens(identity)
131-
print("\nSuccessfully revoked all access tokens for identity with ID: " + identity.properties['id'])
130+
client.revoke_tokens(identity_token_result[0])
131+
print("\nSuccessfully revoked all access tokens for identity with ID: " + identity)
132132
```
133133

134134
## Delete an identity
135135

136136
Deleting an identity revokes all active access tokens and prevents you from issuing access tokens for the identity. It also removes all the persisted content associated with the identity.
137137

138138
```python
139-
client.delete_user(identity)
140-
print("\nDeleted the identity with ID: " + identity.properties['id'])
139+
client.delete_user(identity_token_result[0])
140+
print("\nDeleted the identity with ID: " + identity)
141141
```
142142

143143
## Run the code

0 commit comments

Comments
 (0)