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
Copy file name to clipboardExpand all lines: README.md
+82-58Lines changed: 82 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,6 @@ Yoti SDK carries out for you steps 6, 7 and the profile decryption in step 8.
47
47
48
48

49
49
50
-
51
50
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.
52
51
53
52
## References
@@ -64,75 +63,90 @@ Yoti also allows you to enable user details verification from your mobile app by
64
63
65
64
## Requirements
66
65
67
-
This SDK works with Python 2.6+ and Python 3.3+.
66
+
This SDK works with Python 2.6+ and Python 3.3+.
68
67
69
68
## Installing the SDK
70
69
71
70
To import the Yoti SDK inside your project, simply run the following command from your terminal:
72
71
72
+
```shell
73
+
$ pip install yoti-python-sdk
73
74
```
74
-
$ pip install yoti-python-sdk
75
-
```
76
-
77
-
Both example applications utilise the env variables described above, make sure they are accessible.
4. To execute integration tests run: `py.test -c pytest_integration.ini`
86
+
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).
104
87
105
-
## Configuration
88
+
The following variables are then required for the SDK to work:
106
89
107
-
The YotiClient is the SDK entry point. To initialise it you need include the following snippet inside your endpoint initialisation section:
90
+
*`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
91
+
*`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)
108
92
109
-
```
93
+
Please do not open the pem file as this might corrupt the key and you will need to create a new application.
94
+
95
+
The following env variables are additionally used to configure your backend:
96
+
*`YOTI_APPLICATION_ID` - found on the Integrations settings page, used to configure the [Yoti Login Button](https://www.yoti.com/developers/#login-button-setup).
97
+
98
+
Keeping your settings and access keys outside your repository is highly recommended.
-`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.
118
-
119
-
-`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.
120
-
121
-
Please do not open the pem file as this might corrupt the key and you will need to create a new application.
122
-
123
-
Keeping your settings and access keys outside your repository is highly recommended.
124
109
125
110
## Profile Retrieval
126
111
127
112
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:
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.
140
+
141
+
## Running the tests
142
+
143
+
Run your project but please make sure you have all the correct requirements:
activate the installed interpreters (execute in this directory):
190
+
Sctivate the installed interpreters (execute in this directory):
183
191
184
-
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
192
+
```shell
193
+
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
194
+
```
185
195
186
-
run the tests:
196
+
Run the tests:
187
197
188
-
$ tox
198
+
```shell
199
+
$ tox
200
+
```
189
201
190
202
#### Tox Common Issues ####
191
203
192
204
Supporting multiple Python versions with dependencies, often requiring compilation, is not without issues.
193
205
194
-
For Python versions that do not provide binary wheels for `cryptography`, it
195
-
will have to be compiled. This will be done automatically, however you may
196
-
need to install development headers of `openssl`.
206
+
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)
216
232
217
-
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