Skip to content

Commit 05d42bc

Browse files
committed
[SDK-163]: Added Handling Users section
1 parent 7300005 commit 05d42bc

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,26 @@ def auth():
113113
activity_details = client.get_activity_details(request.args['token'])
114114
```
115115

116-
## Profile Retrieval
116+
## Handling Users
117117

118-
When your application receives a token via the exposed endpoint (it will be assigned to a query string parameter named `token`), you can easily retrieve the user profile by adding the following to your endpoint handler:
118+
When you retrieve the user profile, you receive a user ID generated by Yoti exclusively for your application.
119+
This means that if the same individual logs into another app, Yoti will assign her/him a different ID.
120+
You can use this ID to verify whether (for your application) the retrieved profile identifies a new or an existing user.
121+
Here is an example of how this works:
119122

120123
```python
124+
client = Client(YOTI_CLIENT_SDK_ID, YOTI_KEY_FILE_PATH)
121125
activity_details = client.get_activity_details(request.args['token'])
122-
user_profile = activity_details.user_profile
123-
return render_template('profile.html',
124-
**user_profile)
125126

127+
user_id = activity_details.user_profile.get('user_id')
128+
selfie = activity_details.user_profile.get('selfie')
129+
given_names = activity_details.user_profile.get('given_names')
130+
family_name = activity_details.user_profile.get('family_name')
131+
phone_number = activity_details.user_profile.get('phone_number')
132+
date_of_birth = activity_details.user_profile.get('date_of_birth')
133+
postal_address = activity_details.user_profile.get('postal_address')
134+
gender = activity_details.user_profile.get('gender')
135+
nationality = activity_details.user_profile.get('nationality')
126136
```
127137

128138
## Running the examples

0 commit comments

Comments
 (0)