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
8)[Spring Boot Auto Configuration](#spring-boot-auto-configuration)-
35
+
1)[Spring Boot Auto Configuration](#spring-boot-auto-configuration)-
33
36
Description of utilising Spring Boot
34
37
35
-
9)[Misc](#misc)
38
+
1)[Misc](#misc)
39
+
40
+
1)[Known Issues](#known-issues)-
41
+
Known issues using the libraries
36
42
37
-
10)[Support](#support)-
43
+
1)[Support](#support)-
38
44
Please feel free to reach out
39
45
40
46
## An Architectural view
@@ -55,6 +61,27 @@ Yoti also allows you to enable user details verification from your mobile app by
55
61
* Java 1.6 or higher
56
62
* SLF4J
57
63
64
+
## Building From Source
65
+
66
+
Building from source is generally not necessary for third parties since artifacts are published in Maven Central. However, if you want to build from source you can do so using the [Maven Wrapper](https://github.com/takari/maven-wrapper) that is bundled with this distribution. For those familiar with Gradle this is much like the Gradle Wrapper and ensures that the correct version of Maven is being used.
67
+
68
+
From the top level directory:
69
+
70
+
```bash
71
+
./mvnw clean install
72
+
```
73
+
74
+
Notable flags that you may wish to use to skip certain static analysis/code quality tools are listed below. This is only recommended if you find that these tools are taking too long during development or are flagging false positives that you are yet to exclude. **They should not be ignored when building a candidate for a release unless you are sure that the issues being raised are not a cause for concern.**
75
+
76
+
*`-Dfindbugs.skip=true`: skips findbugs and the findbugs security extension.
77
+
*`-Ddependency-check.skip=true`: skips the OWASP dependency scanner.
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:
Where `yourUserSearchMethod` is a piece of logic in your app that is supposed to find a user, given a userId.
134
174
No matter if the user is a new or an existing one, Yoti will always provide her/his profile, so you don't necessarily need to store it.
135
175
136
-
The `HumanProfile` class provides a set of methods to retrieve different user attributes. Whether the attributes are present or not depends on the settings you have applied to your app on Yoti Dashboard.
176
+
The `com.yoti.api.client.HumanProfile` class provides a set of methods to retrieve different user attributes. Whether the attributes are present or not depends on the settings you have applied to your app on Yoti Dashboard.
137
177
138
178
## Connectivity Requirements
139
179
140
-
Interacting with the `YotiClient` to get `ActivityDetails` is not an offline operation. Your application will need to be able to establish an outbound TCP connection to port 443 to the Yoti servers at `https://api.yoti.com` (by default - see the [Misc](#misc) section).
180
+
Interacting with the `com.yoti.api.client.YotiClient` to get `com.yoti.api.client.ActivityDetails` is not an offline operation. Your application will need to be able to establish an outbound TCP connection to port 443 to the Yoti servers at `https://api.yoti.com` (by default - see the [Misc](#misc) section).
141
181
142
182
By default the Yoti Client will block indefinitely when connecting to the remote server or reading data. Consequently it is **possible that your application thread could be blocked**.
143
183
@@ -175,9 +215,70 @@ For more information and to see an example of this in use take a look at the Spr
175
215
## Misc
176
216
177
217
* By default, Yoti SDKs fetch profiles from [https://api.yoti.com/api/v1](https://api.yoti.com/api/v1).
178
-
If necessary, this can be overridden by setting the *yoti.api.url* system property.
218
+
If necessary, this can be overridden by setting the `yoti.api.url` system property.
179
219
* Yoti Java SDK uses AES-256 encryption. If you are using the Oracle JDK, this key length is not enabled by default. The following stack overflow question explains how to fix this: [http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters](http://stackoverflow.com/questions/6481627/java-security-illegal-key-size-or-default-parameters)
180
220
* To find out how to set up your Java project in order to use this SDK, you can check the Spring Boot example in this repo.
221
+
222
+
## Known Issues
223
+
224
+
### Loading Private Keys
225
+
226
+
#### Affects
227
+
228
+
* Version 1.1 onwards.
229
+
230
+
#### Description
231
+
232
+
There was a known issue with the encoding of RSA private key PEM files that were issued in the past by Yoti Dashboard (most likely where you downloaded the private key for your application).
233
+
234
+
Some software is more accepting that others and will have been able to cope with the incorrect encoding, whereas some stricter libraries will not accept this encoding.
235
+
236
+
At version `1.1` of this client the Java Security Provider that we use (`Bouncy Castle`) was [upgraded](https://www.bouncycastle.org/releasenotes.html) from `1.51` -> `1.57`. This upgrade appears to have made the key parser more strict in terms of encoding since it no longer accepts these incorrectly encoded keys.
237
+
238
+
#### Symptoms
239
+
240
+
This error usually manifests itself when constructing and instance of the Yoti Client to read the private key.
241
+
242
+
Generally you'll encounter an exception with an message and stack trace as follows:
at com.yoti.api.client.spi.remote.SecureYotiClient.loadKeyPair(SecureYotiClient.java:99)
247
+
at com.yoti.api.client.spi.remote.SecureYotiClient.<init>(SecureYotiClient.java:73)
248
+
at com.yoti.api.client.spi.remote.SecureYotiClientFactory.getInstance(SecureYotiClientFactory.java:25)
249
+
at com.yoti.api.client.ServiceLocatorYotiClientBuilder.build(ServiceLocatorYotiClientBuilder.java:40)
250
+
at com.yoti.api.spring.YotiClientAutoConfiguration.yotiClient(YotiClientAutoConfiguration.java:48)
251
+
252
+
Caused by:org.bouncycastle.openssl.PEMException: problem creating RSAprivate key:java.lang.IllegalArgumentException: failed to construct sequence from byte[]: corrupted stream detected
253
+
at org.bouncycastle.openssl.PEMParser$KeyPairParser.parseObject(UnknownSource)
254
+
at org.bouncycastle.openssl.PEMParser.readObject(UnknownSource)
255
+
at com.yoti.api.client.spi.remote.SecureYotiClient$KeyStreamVisitor.findKeyPair(SecureYotiClient.java:269)
256
+
at com.yoti.api.client.spi.remote.SecureYotiClient$KeyStreamVisitor.accept(SecureYotiClient.java:260)
257
+
at com.yoti.api.spring.SpringResourceKeyPairSource.getFromStream(SpringResourceKeyPairSource.java:28)
258
+
at com.yoti.api.client.spi.remote.SecureYotiClient.loadKeyPair(SecureYotiClient.java:97)
259
+
...52 common frames omitted
260
+
261
+
Caused by:org.bouncycastle.openssl.PEMException: problem creating RSAprivate key:java.lang.IllegalArgumentException: failed to construct sequence from byte[]: corrupted stream detected
262
+
at org.bouncycastle.openssl.PEMParser$RSAKeyPairParser.parse(UnknownSource)
263
+
...58 common frames omitted
264
+
265
+
Caused by:java.lang.IllegalArgumentException: failed to construct sequence from byte[]: corrupted stream detected
266
+
at org.bouncycastle.asn1.ASN1Sequence.getInstance(UnknownSource)
267
+
...59 common frames omitted
268
+
```
269
+
270
+
#### How To Fix
271
+
272
+
You can re-encode the badly encoded PEM file using some software that is more accepting of the incorrect encoding and saving the new key.
273
+
274
+
An example of software able to do this is `OpenSSL` versions `1.0.2g` and `1.1.0` using the command:
0 commit comments