cordova-digital-onboarding 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +62 -0
- package/docs/Changelog.md +5 -0
- package/docs/Device-Activation.md +194 -0
- package/docs/Language-Configuration.md +13 -0
- package/docs/Logging.md +22 -0
- package/docs/Process-Configuration.md +59 -0
- package/docs/Readme.md +61 -0
- package/docs/SDK-Integration.md +20 -0
- package/docs/Verifying-User.md +382 -0
- package/docs/_Sidebar.md +12 -0
- package/docs/images/activation-mockup.png +0 -0
- package/docs/images/intro.jpg +0 -0
- package/docs/images/verification-mockup.png +0 -0
- package/lib/index.d.ts +691 -0
- package/lib/index.js +2001 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Wultra Digital Onboarding for mobile JS Platforms
|
|
2
|
+
|
|
3
|
+
<!-- begin remove -->
|
|
4
|
+
<p align="center"><img src="docs/images/intro.jpg" alt="Wultra Digital Onboarding for mobile JS Platforms" width="100%" /></p>
|
|
5
|
+
<!-- end -->
|
|
6
|
+
|
|
7
|
+
<!-- begin box info -->
|
|
8
|
+
The Wultra Digital Onboarding SDK functions as an extension of [Wultra Mobile Authentication (PowerAuth)](https://wultra.com/powerauth) that is required.
|
|
9
|
+
<!-- end -->
|
|
10
|
+
|
|
11
|
+
## Introduction
|
|
12
|
+
|
|
13
|
+
Elevate your standard device activation, user login, and request signing scenarios by incorporating facial recognition and document scanning in diverse situations:
|
|
14
|
+
|
|
15
|
+
- Reclaim access or recover lost credentials through authenticating the user's genuine presence and verifying document validity.
|
|
16
|
+
- Reinforce conventional password or PIN-based authentication with an extra layer of security through face recognition.
|
|
17
|
+
- Seamlessly onboard new customers into your systems, authenticating them with identification cards and facial scans for access to your app.
|
|
18
|
+
|
|
19
|
+
### Other resources
|
|
20
|
+
|
|
21
|
+
We also provide an [Android](https://github.com/wultra/digital-onboarding-android) and [iOS](https://github.com/wultra/digital-onboarding-apple) versions of this library.
|
|
22
|
+
|
|
23
|
+
## What will you need before the implementation
|
|
24
|
+
|
|
25
|
+
<!-- begin box info -->
|
|
26
|
+
The Wultra Digital Onboarding SDK functions as an extension of Wultra Mobile Authentication that is required.
|
|
27
|
+
<!-- end -->
|
|
28
|
+
|
|
29
|
+
Before initiating the integration, it's essential to ensure that your server environment is prepared with appropriately configured services capable of managing user verification and onboarding, seamlessly connecting to your systems.
|
|
30
|
+
|
|
31
|
+
Given the unique characteristics of each customer system, the utilization of this SDK may vary. To accurately outline the user verification process, we recommend consulting with our technical team for tailored guidance.
|
|
32
|
+
|
|
33
|
+
## Document OCR and face verification
|
|
34
|
+
|
|
35
|
+
We seamlessly incorporate industry-leading solutions for document scanning, ensuring versatility and effectiveness in your operations.
|
|
36
|
+
|
|
37
|
+
- iProov for genuine presence
|
|
38
|
+
- Innovatrics for document scanning and genuine presence
|
|
39
|
+
- ZenID for document scanning
|
|
40
|
+
- BlinkID for document scanning
|
|
41
|
+
|
|
42
|
+
Our dedicated technical and sales representatives are available to guide you in selecting the optimal solution that aligns perfectly with your needs.
|
|
43
|
+
|
|
44
|
+
## Documentation
|
|
45
|
+
|
|
46
|
+
<!-- begin box warning -->
|
|
47
|
+
Please be aware that the scenarios outlined in the documentation are illustrative examples. Your user flow and implementation may vary based on your specific requirements and circumstances.
|
|
48
|
+
<!-- end -->
|
|
49
|
+
|
|
50
|
+
The documentation is available at the [Wultra Developer Portal](https://developers.wultra.com/components/digital-onboarding-js) or inside the [docs folder](docs).
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
All sources are licensed using the Apache 2.0 license.
|
|
55
|
+
|
|
56
|
+
## Contact
|
|
57
|
+
|
|
58
|
+
If you need any assistance, do not hesitate to drop us a line at [hello@wultra.com](mailto:hello@wultra.com) or our official [wultra.com/discord](https://wultra.com/discord) channel.
|
|
59
|
+
|
|
60
|
+
### Security Disclosure
|
|
61
|
+
|
|
62
|
+
If you believe you have identified a security vulnerability with Wultra Digital Onboarding, you should report it as soon as possible via email to [support@wultra.com](mailto:support@wultra.com). Please do not post it to a public issue tracker.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Device Activation
|
|
2
|
+
|
|
3
|
+
With `WDOActivationService` you can onboard PowerAuth with just a piece of user information like his email, phone number, or login name.
|
|
4
|
+
|
|
5
|
+
PowerAuth enrolled in such a way will need [further user verification](Verifying-User.md) until fully operational (able to sign operations).
|
|
6
|
+
|
|
7
|
+
## Example app flow
|
|
8
|
+
|
|
9
|
+
<p align="center"><img src="images/activation-mockup.png" alt="Example application flow for the activation" width="100%" /></p>
|
|
10
|
+
|
|
11
|
+
## Creating an instance
|
|
12
|
+
|
|
13
|
+
To create an instance you will need a `PowerAuth` instance that is __ready to be activated__.
|
|
14
|
+
|
|
15
|
+
<!-- begin box info -->
|
|
16
|
+
[Documentation for `PowerAuth Mobile JS SDK`](https://developers.wultra.com/components/react-native-powerauth-mobile-sdk/).
|
|
17
|
+
<!-- end -->
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Example with `PowerAuth` instance:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const powerAuth = new PowerAuth("my-pa-instance")
|
|
24
|
+
powerAuth.configure({
|
|
25
|
+
configuration: "ARCB+...jg==", // base64 PowerAuth configuration
|
|
26
|
+
baseEndpointUrl: "https://my-server-deployment.com/enrollment-server/"
|
|
27
|
+
})
|
|
28
|
+
const activationService = new WDOActivationService(
|
|
29
|
+
powerAuth,
|
|
30
|
+
"https://my-server-deployment.com/enrollment-server-onboarding/"
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Retrieving the status
|
|
35
|
+
|
|
36
|
+
To figure out if the activation process was already started and what is the status, you can use `hasActiveProcess`.
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
/**
|
|
40
|
+
* If the activation process is in progress.
|
|
41
|
+
*
|
|
42
|
+
* Note that even if this property is `true` it can be already discontinued on the server.
|
|
43
|
+
* Calling `status()` for example after the app is launched in this case is recommended.
|
|
44
|
+
*/
|
|
45
|
+
get hasActiveProcess(): boolean;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If the process was started, you can verify its status by calling the `status` function. You can show an appropriate UI to the user based on this status.
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves status of the onboarding activation.
|
|
53
|
+
*
|
|
54
|
+
* @return Promise resolved with onboarding status.
|
|
55
|
+
*/
|
|
56
|
+
status(): Promise<WDOOnboardingStatus>;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`WDOOnboardingStatus` possible values.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
declare enum WDOOnboardingStatus {
|
|
63
|
+
/** Activation part of the process is in progress */
|
|
64
|
+
activationInProgress = "ACTIVATION_IN_PROGRESS",
|
|
65
|
+
/** Verification part of the process is in progress */
|
|
66
|
+
verificationInProgress = "VERIFICATION_IN_PROGRESS",
|
|
67
|
+
/** Onboarding process has failed */
|
|
68
|
+
failed = "FAILED",
|
|
69
|
+
/** Onboarding process is completed */
|
|
70
|
+
finished = "FINISHED"
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Starting the process
|
|
75
|
+
|
|
76
|
+
To start the activation process, you can use any credentials that are sufficient to you that can identify the user.
|
|
77
|
+
|
|
78
|
+
Often, such data are user email, phone number, or userID. The definition of such data is up to your server implementation and requirements.
|
|
79
|
+
|
|
80
|
+
To start the activation, use the `start` function.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
/**
|
|
84
|
+
* Start onboarding activation with user credentials.
|
|
85
|
+
*
|
|
86
|
+
* For example, when you require email, your object would look like this:
|
|
87
|
+
* ```
|
|
88
|
+
* {
|
|
89
|
+
* email: "<user_email>"
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
* @param credentials Object with credentials. Which credentials are needed should be provided by a system/backend provider.
|
|
93
|
+
* @param processType The process type identification. If not specified, the default process type will be used.
|
|
94
|
+
*/
|
|
95
|
+
start(credentials: any, processType?: string): Promise<void>;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Example
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
|
|
102
|
+
class MyUserService {
|
|
103
|
+
// prepared service
|
|
104
|
+
private activationService: WDOActivationService
|
|
105
|
+
|
|
106
|
+
async startActivation(id: string) {
|
|
107
|
+
const data = { userId: id}
|
|
108
|
+
try {
|
|
109
|
+
await this.activationService.start(data)
|
|
110
|
+
// success, continue with `activate()`
|
|
111
|
+
// at this moment, the `hasActiveProcess` starts return true
|
|
112
|
+
} catch (error) {
|
|
113
|
+
// show error to the user
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Creating the activation
|
|
120
|
+
|
|
121
|
+
To activate the user (activating the `PowerAuth` instance), data retrieved from the process start can be used with optional `OTP`. The OTP is usually sent via SMS, email, or other channel. To decide if the OTP is needed, you can use the [Configuration API](Process-Configuration.md) or have it hardcoded.
|
|
122
|
+
|
|
123
|
+
Use the `activate` function to create the activation.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
/**
|
|
127
|
+
* Activate the PowerAuth instance that was passed in the initializer.
|
|
128
|
+
*
|
|
129
|
+
* @param activationName Name of the activation. Device name by default (usually something like John's iPhone or similar).
|
|
130
|
+
* @param otp OTP code received by the user (via SMS or email). Optional when not required.
|
|
131
|
+
* @return Promise resolved with activation result.
|
|
132
|
+
*/
|
|
133
|
+
activate(activationName: string, otp?: string): Promise<WDOPowerAuthActivationResult>;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Example implementation:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
class MyUserService {
|
|
140
|
+
// prepared service
|
|
141
|
+
private activationService: WDOActivationService
|
|
142
|
+
|
|
143
|
+
async activate(smsOTP?: string) {
|
|
144
|
+
try {
|
|
145
|
+
const activationResult = await activationService.activate("my-test-activation", smsOTP)
|
|
146
|
+
// PowerAuthSDK instance was activated.
|
|
147
|
+
// At this moment, navigate the user to
|
|
148
|
+
// the PIN keyboard to finish the PowerAuthSDK initialization.
|
|
149
|
+
// For more information, follow the PowerAuthSDK documentation.
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (allowOnboardingOtpRetry(error)) {
|
|
152
|
+
// User entered the wrong OTP, prompt for a new one.
|
|
153
|
+
// Remaining OTP attempts count: onboardingOtpRemainingAttempts(error)
|
|
154
|
+
} else {
|
|
155
|
+
// show error UI
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Canceling the process
|
|
163
|
+
|
|
164
|
+
To cancel the process, just call the `cancel` function.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
/**
|
|
168
|
+
* Cancel the activation process (issues a cancel request to the backend and clears the local process ID).
|
|
169
|
+
*
|
|
170
|
+
* @param forceCancel When true, the process will be canceled in the SDK even when fails on backend. `true` by default.
|
|
171
|
+
*/
|
|
172
|
+
cancel(forceCancel?: boolean): Promise<void>;
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## OTP resend
|
|
176
|
+
|
|
177
|
+
In some cases, you need to resent the OTP:
|
|
178
|
+
- OTP was not received by the user (for example when the email ends in the spam folder).
|
|
179
|
+
- OTP expired.
|
|
180
|
+
|
|
181
|
+
For such cases, use `resendOTP` function.
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
/**
|
|
185
|
+
* OTP resend request.
|
|
186
|
+
*
|
|
187
|
+
* This is intended to be displayed for the user to use in case of the OTP is not received.
|
|
188
|
+
* For example, when the user does not receive SMS after some time, there should be a button to "send again".
|
|
189
|
+
*/
|
|
190
|
+
resendOTP(): Promise<void>;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Read next
|
|
194
|
+
- [Verifying User With Document Scan And Genuine Presence Check](Verifying-User.md)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Language Configuration
|
|
2
|
+
|
|
3
|
+
The language of content that might be localized can be configured via `changeAcceptLanguage` method on both `WDOActivationService` and `WDOVerificationService`.
|
|
4
|
+
|
|
5
|
+
The default language is `en`. Availability of languages depends on server configuration and implementation.
|
|
6
|
+
|
|
7
|
+
<!-- begin box info -->
|
|
8
|
+
The language configuration is a wrap-around of the underlying networking language configuration described in [our networking library documentation](https://github.com/wultra/networking-js).
|
|
9
|
+
<!-- end -->
|
|
10
|
+
|
|
11
|
+
## Read next
|
|
12
|
+
|
|
13
|
+
- [Logging](Logging.md)
|
package/docs/Logging.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Logging
|
|
2
|
+
|
|
3
|
+
You can set up logging for the library using the `WDOLogger` class.
|
|
4
|
+
|
|
5
|
+
<!-- begin box info -->
|
|
6
|
+
Networking traffic is logged in its own logger described in the [networking library documentation](https://github.com/wultra/networking-js).
|
|
7
|
+
<!-- end -->
|
|
8
|
+
|
|
9
|
+
### Verbosity Level
|
|
10
|
+
|
|
11
|
+
You can limit the amount of logged information via the `verboseLevel` property.
|
|
12
|
+
|
|
13
|
+
| Level | Description |
|
|
14
|
+
| ---------------------- | ------------------------------------------------- |
|
|
15
|
+
| `NONE` | Silences all messages. |
|
|
16
|
+
| `ERROR` _(default)_ | Only errors will be logged. |
|
|
17
|
+
| `WARNING` | Errors and warnings will be logged. |
|
|
18
|
+
| `INFO` | Error, warning and info messages will be logged. |
|
|
19
|
+
| `DEBUG` | All messages will be logged. |
|
|
20
|
+
### Logger Delegate
|
|
21
|
+
|
|
22
|
+
In case you want to process logs on your own (for example log into a file or some cloud service), you can set `WDOLogger.listener`.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Process Configuration
|
|
2
|
+
|
|
3
|
+
With `WDOConfigurationService` you can retrieve the configuration of the onboarding process from the server. The configuration contains information about which steps are required to be performed during the onboarding process and which document types are supported or required for scanning.
|
|
4
|
+
|
|
5
|
+
## Retrieving the configuration
|
|
6
|
+
|
|
7
|
+
To retrieve the configuration, create an instance of `WDOConfigurationService` and call the `getConfiguration` method with the process type identifier.
|
|
8
|
+
|
|
9
|
+
Example:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
|
|
13
|
+
const powerAuth = new PowerAuth("my-pa-instance")
|
|
14
|
+
powerAuth.configure({
|
|
15
|
+
configuration: "ARCB+...jg==", // base64 PowerAuth configuration
|
|
16
|
+
baseEndpointUrl: "https://my-server-deployment.com/enrollment-server/"
|
|
17
|
+
})
|
|
18
|
+
const configurationService = new WDOConfigurationService(
|
|
19
|
+
powerAuth,
|
|
20
|
+
"https://my-server-deployment.com/enrollment-server-onboarding/"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const procesType = "onboarding" // defined on your server
|
|
24
|
+
const config = await configurationService.getConfiguration(procesType)
|
|
25
|
+
console.log("Configuration:", config)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Configuration response
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
/** Configuration for the onboarding process */
|
|
32
|
+
interface WDOConfigurationResponse {
|
|
33
|
+
/** Is the onboarding process enabled */
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
/** Is OTP required for the first part - identification/activation. */
|
|
36
|
+
otpForIdentification: boolean;
|
|
37
|
+
/** Is OTP required for the second part - identity verification. */
|
|
38
|
+
otpForIdentityVerification: boolean;
|
|
39
|
+
/** Documents required for identity verification. */
|
|
40
|
+
documents: {
|
|
41
|
+
/** Number of required documents */
|
|
42
|
+
requiredDocumentsCount: number;
|
|
43
|
+
/** List of documents */
|
|
44
|
+
items: Array<WDOConfigurationDocument>;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Configuration for a document */
|
|
48
|
+
interface WDOConfigurationDocument {
|
|
49
|
+
/** Type of the document */
|
|
50
|
+
type: string;
|
|
51
|
+
/** Is the document mandatory */
|
|
52
|
+
mandatory: boolean;
|
|
53
|
+
/** Number of sides the document has */
|
|
54
|
+
sideCount: number;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Read next
|
|
59
|
+
- [Device Activation](Device-Activation.md)
|
package/docs/Readme.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Wultra Digital Onboarding for JS Mobile Platforms
|
|
2
|
+
|
|
3
|
+
<!-- begin remove -->
|
|
4
|
+
<p align="center"><img src="images/intro.jpg" alt="Wultra Digital Onboarding for JS Mobile Platforms" width="100%" /></p>
|
|
5
|
+
<!-- end -->
|
|
6
|
+
|
|
7
|
+
Elevate your standard device activation, user login, and request signing scenarios by incorporating facial recognition and document scanning in diverse situations:
|
|
8
|
+
|
|
9
|
+
- Reclaim access or recover lost credentials through authenticating the user's genuine presence and verifying document validity.
|
|
10
|
+
- Reinforce conventional password or PIN-based authentication with an extra layer of security through face recognition.
|
|
11
|
+
- Seamlessly onboard new customers into your systems, authenticating them with identification cards and facial scans for access to your app.
|
|
12
|
+
|
|
13
|
+
### Supported Platforms
|
|
14
|
+
|
|
15
|
+
- Cordova
|
|
16
|
+
- (TBA) React Native
|
|
17
|
+
|
|
18
|
+
### Other resources
|
|
19
|
+
|
|
20
|
+
We also provide an [Android](https://github.com/wultra/digital-onboarding-android) and [iOS](https://github.com/wultra/digital-onboarding-apple) version of the Wultra Digital Onboarding SDK.
|
|
21
|
+
|
|
22
|
+
## What will you need before the implementation
|
|
23
|
+
|
|
24
|
+
<!-- begin box info -->
|
|
25
|
+
The Wultra Digital Onboarding SDK functions as an extension of [Wultra Mobile Authentication (PowerAuth)](https://github.com/wultra/react-native-powerauth-mobile-sdk) that is required.
|
|
26
|
+
<!-- end -->
|
|
27
|
+
|
|
28
|
+
Before initiating the integration, it's essential to ensure that your server environment is prepared with appropriately configured services capable of managing user verification and onboarding, seamlessly connecting to your systems.
|
|
29
|
+
|
|
30
|
+
Given the unique characteristics of each customer system, the utilization of this SDK may vary. To accurately outline the user verification process, we recommend consulting with our technical team for tailored guidance.
|
|
31
|
+
|
|
32
|
+
## Document OCR and face verification
|
|
33
|
+
|
|
34
|
+
We seamlessly incorporate industry-leading solutions for document scanning, ensuring versatility and effectiveness in your operations.
|
|
35
|
+
|
|
36
|
+
- iProov for genuine presence
|
|
37
|
+
- BlinkID for document scanning
|
|
38
|
+
- Innovatrics for document scanning and genuine presence
|
|
39
|
+
- ZenID for document scanning
|
|
40
|
+
|
|
41
|
+
Our dedicated technical and sales representatives are available to guide you in selecting the optimal solution that aligns perfectly with your needs.
|
|
42
|
+
|
|
43
|
+
## Open Source Code
|
|
44
|
+
|
|
45
|
+
The code of the library is open source and you can freely browse it in our GitHub at [https://github.com/wultra/digital-onboarding-js](https://github.com/wultra/digital-onboarding-js/tree/develop/)
|
|
46
|
+
|
|
47
|
+
<!-- begin remove -->
|
|
48
|
+
## Integration Tutorials
|
|
49
|
+
- [SDK Integration](SDK-Integration.md)
|
|
50
|
+
- [Process Configuration](Process-Configuration.md)
|
|
51
|
+
- [Device Activation (With Weak Credentials)](Device-Activation.md)
|
|
52
|
+
- [Verifying User With Document Scan And Genuine Presence Check](Verifying-User.md)
|
|
53
|
+
- [Language Configuration](Language-Configuration.md)
|
|
54
|
+
- [Logging](Logging.md)
|
|
55
|
+
- [Changelog](Changelog.md)
|
|
56
|
+
|
|
57
|
+
<!-- end -->
|
|
58
|
+
|
|
59
|
+
## Read next
|
|
60
|
+
|
|
61
|
+
- [SDK Integration](SDK-Integration.md)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# SDK Integration
|
|
2
|
+
|
|
3
|
+
## Cordova Installation
|
|
4
|
+
|
|
5
|
+
### Requirements
|
|
6
|
+
|
|
7
|
+
- Cordova >=12.0.0
|
|
8
|
+
- [PowerAuth Mobile JS SDK](https://github.com/wultra/react-native-powerauth-mobile-sdk) needs to be available in your project
|
|
9
|
+
|
|
10
|
+
### Add via cordova CLI
|
|
11
|
+
|
|
12
|
+
Add `cordova-digital-onboarding` package to your Cordova project using the following command:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cordova plugin add cordova-digital-onboarding
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Read next
|
|
19
|
+
|
|
20
|
+
- [Process Configuration](Process-Configuration.md)
|