You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updating with a simpler solution by initializing identity correctly
Initialize identity correctly with:
# Issue an identity and an access token with the "voip" scope for the new identity
identity_token_result = client.create_user_and_token(["voip"])
identity = identity_token_result[0]
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.
128
128
129
129
```python
130
-
client.revoke_tokens(identity_token_result[0])
131
-
print("\nSuccessfully revoked all access tokens for identity with ID: "+ identity)
130
+
client.revoke_tokens(identity)
131
+
print("\nSuccessfully revoked all access tokens for identity with ID: "+ identity.properties['id'])
132
132
```
133
133
134
134
## Delete an identity
135
135
136
136
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.
137
137
138
138
```python
139
-
client.delete_user(identity_token_result[0])
140
-
print("\nDeleted the identity with ID: "+ identity)
139
+
client.delete_user(identity)
140
+
print("\nDeleted the identity with ID: "+ identity.properties['id'])
0 commit comments