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
This package integrates your Python back-end with [Yoti](https://www.yoti.com/) allowing you to
4
-
securely verify users' identities.
3
+
Welcome to the Yoti Python SDK. This repo contains the tools and step by step instructions you need to quickly integrate your Python back-end with Yoti so that your users can share their identity details with your application in a secure and trusted way.
For more details and working [Flask](http://flask.pocoo.org/) and [Django](https://www.djangoproject.com/)
17
-
applications see [examples/](https://github.com/getyoti/yoti-python-sdk/tree/master/examples).
13
+
3)[Requirements](#requirements)-
14
+
Everything you need to get started
18
15
16
+
4)[Installing the SDK](#installing-the-sdk)-
17
+
How to install our SDK
19
18
20
-
## The Flow ##
19
+
5)[SDK Project import](#sdk-project-import)-
20
+
How to install the SDK to your project
21
21
22
-
Assuming you created an application and chose `/callback` as your application's callback on [Yoti Dashboard](https://www.yoti.com/dashboard/),
23
-
this endpoint will receive a `token` from Yoti API each time user wishes to share information with you (see the example above).
24
-
This token, encrypted with the private key from `.PEM` container, will be used to send a request to Yoti
25
-
for user's profile details. That's all folks!
22
+
6)[Configuration](#configuration)-
23
+
Entry point explanation
26
24
27
-
For details see [Yoti Developers Docs](https://www.yoti.com/developers/).
25
+
7)[Profile Retrieval](#profile-retrieval)-
26
+
How to retrieve a Yoti profile using the token
28
27
29
-
## Installation ##
28
+
8)[Running the examples](#running-the-examples)-
29
+
How to retrieve a Yoti profile using the token
30
30
31
-
$ pip install yoti-python-sdk
31
+
9)[Running the tests](#running-the-tests)-
32
+
How to retrieve a Yoti profile using the token
32
33
33
-
This SDK works with Python 2.6+ and Python 3.3+ .
34
+
10)[API Coverage](#api-coverage)-
35
+
Attributes defined
34
36
35
-
## Configuration ##
37
+
11)[Running the tests](running-the-tests)-
38
+
Running tests for SDK example
36
39
37
-
After creating your application on the [Yoti Dashboard](https://www.yoti.com/dashboard/), you need to download
38
-
the `.PEM` key and save it *outside* the repo (keep it private).
40
+
12)[Support](#support)-
41
+
Please feel free to reach out
39
42
40
-
The following env variables are then required for the SDK to work:
43
+
13)[Version Support](version-support) -
44
+
Extra information on ensuring correct version of Python is being used
41
45
42
-
*`YOTI_CLIENT_SDK_ID` - found on the Integrations settings page
43
-
*`YOTI_KEY_FILE_PATH` - the full path to your private key downloaded from the Keys settings page (e.g. /home/user/.ssh/access-security.pem)
46
+
## An Architectural view
47
+
48
+
Before you start your integration, here is a bit of background on how the integration works. To integrate your application with Yoti, your back-end must expose a GET endpoint that Yoti will use to forward tokens.
49
+
The endpoint can be configured in the Yoti Dashboard when you create/update your application. For more information on how to create an application please check our [developer page](https://www.yoti.com/developers/documentation/#login-button-setup).
50
+
51
+
The image below shows how your application back-end and Yoti integrate into the context of a Login flow.
52
+
Yoti SDK carries out for you steps 6, 7 and the profile decryption in step 8.
53
+
54
+

55
+
56
+
Yoti also allows you to enable user details verification from your mobile app by means of the Android (TBA) and iOS (TBA) SDKs. In that scenario, your Yoti-enabled mobile app is playing both the role of the browser and the Yoti app. Your back-end doesn't need to handle these cases in a significantly different way. You might just decide to handle the `User-Agent` header in order to provide different responses for desktop and mobile clients.
To import the Yoti SDK inside your project, simply run the following command from your terminal:
77
+
78
+
```shell
79
+
$ pip install yoti-python-sdk
80
+
```
81
+
82
+
## SDK Project import
83
+
84
+
You can reference the project URL by adding the following import:
85
+
86
+
```python
87
+
import"yoti_python_sdk"
88
+
```
89
+
90
+
## Configuration
91
+
92
+
After creating your application on the [Yoti Dashboard](https://www.yoti.com/dashboard/), you need to download the `.PEM` key and save it *outside* the repo (keep it private).
93
+
94
+
The following variables are then required for the SDK to work:
95
+
96
+
*`YOTI_CLIENT_SDK_ID` - is the SDK identifier generated by Yoti Dashboard in the Key tab when you create your app. Note this is not your Application Identifier which is needed by your client-side code
97
+
*`YOTI_KEY_FILE_PATH` - is the path to the application pem file. It can be downloaded only once from the Keys tab in your Yoti Dashboard. (e.g. /home/user/.ssh/access-security.pem)
98
+
99
+
Please do not open the pem file as this might corrupt the key and you will need to create a new application.
44
100
45
101
The following env variables are additionally used to configure your backend:
102
+
*`YOTI_APPLICATION_ID` - found on the Integrations settings page, used to configure the [Yoti Login Button](https://www.yoti.com/developers/#login-button-setup).
103
+
104
+
Keeping your settings and access keys outside your repository is highly recommended.
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:
46
119
47
-
*`YOTI_APPLICATION_ID` - found on the Integrations settings page, used to configure the [Yoti Login Button](https://www.yoti.com/developers/#login-button-setup)
Plugins for both Django and Flask are in the `plugins/` dir. Their purpose is to make it as easy as possible to use
69
-
Yoti SDK with those frameworks. See their respective `README`'s for details.
145
+
Plugins for both Django and Flask are in the `plugins/` dir. Their purpose is to make it as easy as possible to use the Yoti SDK with those frameworks. See their respective `README` files for details.
70
146
147
+
## Running the tests
71
148
72
-
## Executing tests ##
149
+
Run your project but please make sure you have all the correct requirements:
activate the installed interpreters (execute in this directory):
196
+
Sctivate the installed interpreters (execute in this directory):
100
197
101
-
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
198
+
```shell
199
+
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
200
+
```
102
201
103
-
run the tests:
202
+
Run the tests:
104
203
105
-
$ tox
204
+
```shell
205
+
$ tox
206
+
```
106
207
107
208
#### Tox Common Issues ####
108
209
109
210
Supporting multiple Python versions with dependencies, often requiring compilation, is not without issues.
110
211
111
-
For Python versions that do not provide binary wheels for `cryptography`, it
112
-
will have to be compiled. This will be done automatically, however you may
113
-
need to install development headers of `openssl`.
212
+
For Python versions that do not provide binary wheels for `cryptography`, it will have to be compiled. This will be done automatically, however, you may need to install development headers of `openssl`.
To avoid `cffi` errors related to unicode see: [cffi ucs2 vs ucs4](http://cffi.readthedocs.io/en/latest/installation.html#linux-and-os-x-ucs2-versus-ucs4)
Please provide the following the get you up and working as quick as possible:
133
243
134
-
to avoid `cffi` errors related to unicode see: [cffi ucs2 vs ucs4](http://cffi.readthedocs.io/en/latest/installation.html#linux-and-os-x-ucs2-versus-ucs4)
0 commit comments