@eid-easy/eideasy-widget 2.172.2 → 2.172.3-beta.2
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 +7 -7
- package/README.md +87 -16
- package/dist/eideasy-widget.mjs +33250 -0
- package/dist/eideasy-widget.umd.js +4587 -0
- package/dist/favicon.ico +0 -0
- package/package.json +58 -111
- package/CHANGELOG-LATEST.md +0 -9
- package/CHANGELOG.md +0 -2665
- package/dist/full/eideasy-widget.common.js +0 -68189
- package/dist/full/eideasy-widget.umd.js +0 -68200
- package/dist/full/eideasy-widget.umd.min.js +0 -14
- package/dist/full/fonts/verimi-roboto-v20-latin-500.woff +0 -0
- package/dist/full/fonts/verimi-roboto-v20-latin-500.woff2 +0 -0
- package/dist/index.html +0 -305
- package/dist/widget-only/demo.html +0 -1
- package/dist/widget-only/eideasy-widget.common.js +0 -41707
- package/dist/widget-only/eideasy-widget.umd.js +0 -41726
- package/dist/widget-only/eideasy-widget.umd.min.js +0 -14
|
Binary file
|
|
Binary file
|
package/dist/index.html
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang=""><head>
|
|
2
|
-
<meta charset="utf-8">
|
|
3
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
4
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
5
|
-
<link rel="icon" href="/favicon.ico">
|
|
6
|
-
<title>@eid-easy/eideasy-widget</title>
|
|
7
|
-
|
|
8
|
-
<style>
|
|
9
|
-
h2 {
|
|
10
|
-
text-align: center;
|
|
11
|
-
margin-top: 40px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.container {
|
|
15
|
-
max-width: 768px;
|
|
16
|
-
margin: 0 auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.widgetHolder {
|
|
20
|
-
max-width: 490px;
|
|
21
|
-
//max-width: 700px;
|
|
22
|
-
margin-left: auto;
|
|
23
|
-
margin-right: auto;
|
|
24
|
-
}
|
|
25
|
-
</style>
|
|
26
|
-
</head>
|
|
27
|
-
<body>
|
|
28
|
-
<noscript>
|
|
29
|
-
<strong>We're sorry but @eid-easy/eideasy-widget doesn't work properly without JavaScript enabled.
|
|
30
|
-
Please enable it to continue.</strong>
|
|
31
|
-
</noscript>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<div class="container">
|
|
35
|
-
<div style="margin-top: 10px; margin-bottom: 10px;">
|
|
36
|
-
<label for="langPicker">Language:</label>
|
|
37
|
-
<select name="langPicker" id="langPicker">
|
|
38
|
-
<option value="cs">Czech</option>
|
|
39
|
-
<option value="nl">Dutch</option>
|
|
40
|
-
<option value="en" selected="">English</option>
|
|
41
|
-
<option value="et">Estonian</option>
|
|
42
|
-
<option value="fi">Finnish</option>
|
|
43
|
-
<option value="fr">French</option>
|
|
44
|
-
<option value="de">German</option>
|
|
45
|
-
<option value="it">Italian</option>
|
|
46
|
-
<option value="lv">Latvian</option>
|
|
47
|
-
<option value="lt">Lithuanian</option>
|
|
48
|
-
<option value="pl">Polish</option>
|
|
49
|
-
<option value="pt">Portuguese</option>
|
|
50
|
-
<option value="ru">Russian</option>
|
|
51
|
-
<option value="es">Spanish</option>
|
|
52
|
-
<option value="sv">Swedish</option>
|
|
53
|
-
<option value="da">Danish</option>
|
|
54
|
-
</select>
|
|
55
|
-
</div>
|
|
56
|
-
<h2>Signatures</h2>
|
|
57
|
-
<div id="signingWidgetHolder" class="widgetHolder"></div>
|
|
58
|
-
<h2>Signature Certs</h2>
|
|
59
|
-
<div id="signingCertWidgetHolder" class="widgetHolder"></div>
|
|
60
|
-
<h2>Identification</h2>
|
|
61
|
-
<div id="identificationWidgetHolder" class="widgetHolder"></div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<script>
|
|
65
|
-
function initIdentificationWidget(widgetHolder) {
|
|
66
|
-
const eidEasyWidget = document.createElement('eideasy-widget');
|
|
67
|
-
|
|
68
|
-
const settings = {
|
|
69
|
-
countryCode: 'EE', // ISO 3166 two letter country code
|
|
70
|
-
language: 'en', // ISO 639-1 two letter language code,
|
|
71
|
-
sandbox: true,
|
|
72
|
-
clientId: '9kKmNtYQ7LDOlHvasAE9oYQ0gKS4V4Bl',
|
|
73
|
-
redirectUri: 'https://id.eideasy.eu/admin/oauthlogin', // this gets used for redirects e.g. when using eParaksts mobile
|
|
74
|
-
apiEndpoints: {
|
|
75
|
-
base: () => 'https://id.eideasy.eu',
|
|
76
|
-
identityStart: () => 'https://eid-sample-app.eu/api/identity/start',
|
|
77
|
-
identityFinish: () => 'https://eid-sample-app.eu/api/identity/finish',
|
|
78
|
-
},
|
|
79
|
-
translations: {
|
|
80
|
-
'et': {
|
|
81
|
-
"message": "Mina olen antud kasutaja poolt i18n !!",
|
|
82
|
-
},
|
|
83
|
-
'en': {
|
|
84
|
-
message: "I am provided in settings",
|
|
85
|
-
}
|
|
86
|
-
}, // translations object to override existing translations
|
|
87
|
-
// identification: true or 'all' will enable all methods
|
|
88
|
-
// if you want to enable specific methods, then use
|
|
89
|
-
// identification: ['ee-id-login', 'lv-id-login'],
|
|
90
|
-
enabledMethods: {
|
|
91
|
-
identification: 'all',
|
|
92
|
-
//identification: ['ee-id-login', 'lv-id-login'],
|
|
93
|
-
},
|
|
94
|
-
// mode: 'oidcAuthorize',
|
|
95
|
-
clientInfo: {
|
|
96
|
-
websiteName: 'TestWebsite.test',
|
|
97
|
-
companyName: 'TestCompany',
|
|
98
|
-
},
|
|
99
|
-
selectedMethod: null,
|
|
100
|
-
enabledCountries: 'all',
|
|
101
|
-
// use these to prefill the input values
|
|
102
|
-
inputValues: {
|
|
103
|
-
//idcode: '',
|
|
104
|
-
// phone: '00000766',
|
|
105
|
-
},
|
|
106
|
-
modifyRequestSettings: (currentSettings) => {
|
|
107
|
-
return {
|
|
108
|
-
data: {
|
|
109
|
-
xsrf_token: 'some-token',
|
|
110
|
-
},
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
formatFlashMessage: (message) => {
|
|
114
|
-
if (message.response && message.response.status) {
|
|
115
|
-
if (message.response.status === 419) {
|
|
116
|
-
message.text = 'Session expired, please refresh your browser';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return message;
|
|
120
|
-
},
|
|
121
|
-
onSuccess: function (data) {
|
|
122
|
-
console.log('!!!!!! success !!!!!!!');
|
|
123
|
-
console.log(data);
|
|
124
|
-
},
|
|
125
|
-
onFail: function (error) {
|
|
126
|
-
console.log('!!!!!! fail !!!!!!!');
|
|
127
|
-
console.log(error);
|
|
128
|
-
},
|
|
129
|
-
onStarted: function (data) {
|
|
130
|
-
console.log('!!!!!! started !!!!!!!');
|
|
131
|
-
console.log(data);
|
|
132
|
-
},
|
|
133
|
-
methodsConfigFilter(methods) {
|
|
134
|
-
console.log(
|
|
135
|
-
methods.identification.filter(({actionType}) => actionType.includes('eparaksts'))
|
|
136
|
-
);
|
|
137
|
-
const modifiedMethods = {};
|
|
138
|
-
|
|
139
|
-
modifiedMethods.signature = methods.signature.map((method) => {
|
|
140
|
-
if (method.actionType === 'smart-id-signature') {
|
|
141
|
-
method.supportedCountries.push('FI');
|
|
142
|
-
return method;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
modifiedMethods.signature = methods.identification.map((method) => {
|
|
146
|
-
if (method.actionType === 'smartid') {
|
|
147
|
-
method.supportedCountries.push('FI');
|
|
148
|
-
return method;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
return methods;
|
|
152
|
-
},
|
|
153
|
-
modifyEndpointUrl(urlString) {
|
|
154
|
-
return urlString;
|
|
155
|
-
},
|
|
156
|
-
oauthParamState: 'custom-state-value-from-widget',
|
|
157
|
-
fieldAutocomplete: true,
|
|
158
|
-
allowMethodChange: true,
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
Object.keys(settings).forEach(key => {
|
|
162
|
-
eidEasyWidget[key] = settings[key];
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
widgetHolder.appendChild(eidEasyWidget);
|
|
166
|
-
return eidEasyWidget;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function initSigningWidget(widgetHolder, methods = [], mode = null) {
|
|
170
|
-
const eidEasyWidget = document.createElement('eideasy-widget');
|
|
171
|
-
|
|
172
|
-
const settings = {
|
|
173
|
-
debug: true,
|
|
174
|
-
countryCode: 'EE', // ISO 3166 two letter country code
|
|
175
|
-
language: 'en', // ISO 639-1 two letter language code,
|
|
176
|
-
sandbox: true,
|
|
177
|
-
clientId: '9kKmNtYQ7LDOlHvasAE9oYQ0gKS4V4Bl',
|
|
178
|
-
docId: 'eeHyfsOFU22CJfOn8n3ruBGn7Oiry6BFwZ3dbC2S',
|
|
179
|
-
apiEndpoints: {
|
|
180
|
-
// base: () => 'http://localhost:8000',
|
|
181
|
-
base: () => 'https://id.eideasy.eu',
|
|
182
|
-
},
|
|
183
|
-
translations: {
|
|
184
|
-
'et': {
|
|
185
|
-
"message": "Mina olen antud kasutaja poolt i18n !!",
|
|
186
|
-
},
|
|
187
|
-
'en': {
|
|
188
|
-
message: "I am provided in settings",
|
|
189
|
-
}
|
|
190
|
-
}, // translations object to override existing translations
|
|
191
|
-
// identification: true or 'all' will enable all methods
|
|
192
|
-
// if you want to enable specific methods, then use
|
|
193
|
-
// identification: ['ee-id-login', 'lv-id-login'],
|
|
194
|
-
enabledMethods: {
|
|
195
|
-
signature: methods.length > 0 ? methods : 'all',
|
|
196
|
-
},
|
|
197
|
-
selectedMethod: null,
|
|
198
|
-
enabledCountries: 'all',
|
|
199
|
-
// use these to prefill the input values
|
|
200
|
-
inputValues: {
|
|
201
|
-
// idcode: '',
|
|
202
|
-
//phone: '00000766',
|
|
203
|
-
//callingCode: '+372',
|
|
204
|
-
},
|
|
205
|
-
modifyRequestSettings: (currentSettings) => {
|
|
206
|
-
return {
|
|
207
|
-
data: {
|
|
208
|
-
xsrf_token: 'some-token',
|
|
209
|
-
},
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
formatFlashMessage: (message) => {
|
|
213
|
-
if (message.response && message.response.status) {
|
|
214
|
-
if (message.response.status === 419) {
|
|
215
|
-
message.text = 'Session expired, please refresh your browser';
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return message;
|
|
219
|
-
},
|
|
220
|
-
beforeMethodSelection: function(data) {
|
|
221
|
-
console.log('-------- beforeMethodSelection ----------');
|
|
222
|
-
console.log(data);
|
|
223
|
-
// returning false here prevents the flow from proceeding further
|
|
224
|
-
// return false;
|
|
225
|
-
|
|
226
|
-
// you can provide additional config for methods here
|
|
227
|
-
/*
|
|
228
|
-
return {
|
|
229
|
-
additionalMethodConfig: {
|
|
230
|
-
docId: 'asfjalsfalshfakfhaslkfhas',
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
*/
|
|
234
|
-
},
|
|
235
|
-
onSuccess: function (data) {
|
|
236
|
-
console.log('!!!!!! success !!!!!!!');
|
|
237
|
-
console.log(data);
|
|
238
|
-
},
|
|
239
|
-
onFail: function (error) {
|
|
240
|
-
console.log('!!!!!! fail !!!!!!!');
|
|
241
|
-
console.log(error);
|
|
242
|
-
},
|
|
243
|
-
onStarted: function (data) {
|
|
244
|
-
console.log('!!!!!! started !!!!!!!');
|
|
245
|
-
console.log(data);
|
|
246
|
-
},
|
|
247
|
-
remoteMonitoringEnabled: true,
|
|
248
|
-
otpEmail: 'mj@eideasy.com',
|
|
249
|
-
redirect: res => {
|
|
250
|
-
console.log('redirecting to', res.data.redirect_uri);
|
|
251
|
-
window.location.href = res.data.redirect_uri;
|
|
252
|
-
},
|
|
253
|
-
//emailToken: 'gher0eqq9drrh5u6',
|
|
254
|
-
//otpPhone: '+37255548246',
|
|
255
|
-
isOtpSent: false,
|
|
256
|
-
//otpFlow: 'start-at-method-selection',
|
|
257
|
-
requireHandwrittenSignature: true,
|
|
258
|
-
fieldAutocomplete: true,
|
|
259
|
-
showSignatureLevel: true,
|
|
260
|
-
// waitForChallengeCode: true,
|
|
261
|
-
mode,
|
|
262
|
-
//showSignaturePolicyLink: false,
|
|
263
|
-
//showPoweredByEidEasyLink: false,
|
|
264
|
-
// uiTheme: {
|
|
265
|
-
// colorPrimary: '#d51111',
|
|
266
|
-
// colorSecondary: '#00ff00',
|
|
267
|
-
// textColor: '#0000ff',
|
|
268
|
-
// buttonTextColor: 'rgb(6,192,164)',
|
|
269
|
-
// buttonColor: '#000000',
|
|
270
|
-
// buttonColorHover: '#252323',
|
|
271
|
-
// inputLabelColor: '#04048d',
|
|
272
|
-
// fontFamily: '"Gill Sans", sans-serif',
|
|
273
|
-
// fontSize: '16px',
|
|
274
|
-
// fontWeight: 'bold',
|
|
275
|
-
// },
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
Object.keys(settings).forEach(key => {
|
|
279
|
-
eidEasyWidget[key] = settings[key];
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
widgetHolder.appendChild(eidEasyWidget);
|
|
283
|
-
return eidEasyWidget;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const signingWidget = initSigningWidget(document.getElementById('signingWidgetHolder'));
|
|
287
|
-
const signingCertWidget = initSigningWidget(
|
|
288
|
-
document.getElementById('signingCertWidgetHolder'),
|
|
289
|
-
['id-signature', 'lt-id-signature', 'lv-id-signature', 'fi-id-signature'],
|
|
290
|
-
'cscApiAuthorizeCredential'
|
|
291
|
-
);
|
|
292
|
-
const identificationWidget = initIdentificationWidget(document.getElementById('identificationWidgetHolder'));
|
|
293
|
-
|
|
294
|
-
document
|
|
295
|
-
.getElementById('langPicker')
|
|
296
|
-
.addEventListener('change', (e) => {
|
|
297
|
-
identificationWidget.language = e.target.value;
|
|
298
|
-
signingWidget.language = e.target.value;
|
|
299
|
-
signingCertWidget.language = e.target.value;
|
|
300
|
-
});
|
|
301
|
-
</script>
|
|
302
|
-
<!-- built files will be auto injected -->
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
<script src="/full/eideasy-widget.umd.min.js"></script></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><meta charset="utf-8"><title>eideasy-widget demo</title><script src="./eideasy-widget.umd.js"></script><script>console.log(eideasy-widget)</script>
|