webledger-auth-plugin 2.0.4 → 2.0.6

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.
@@ -15,6 +15,13 @@ declare module '@ioc:AuthService' {
15
15
  logoutURL(): string;
16
16
  checkLoginURL(): string;
17
17
  forgotPasswordMobile(params: any): Promise<any>;
18
+ createRegisterWebAuthnChallenge(uuid: string, origin: string): Promise<any>;
19
+ registerWebAuthnCredential(uuid: string, params: any): Promise<any>;
20
+ createLoginWebAuthnChallenge(origin: string): Promise<any>;
21
+ loginWithWebAuthnCredential(params: any): Promise<any>;
22
+ deleteWebAuthnCredential(uuid: string, id: string): Promise<any>;
23
+ listWebAuthnCredentials(uuid: string): Promise<any>;
24
+ updateWebAuthnCredential(uuid: string, id: string, params: any): Promise<any>;
18
25
  }
19
26
  const authService: AuthServiceI;
20
27
  export default authService;
@@ -67,4 +67,11 @@ export default class AuthService implements AuthServiceI {
67
67
  forgotPasswordMobile(params: any): Promise<import("axios").AxiosResponse<any, any>>;
68
68
  logoutURL(): string;
69
69
  checkLoginURL(): string;
70
+ createRegisterWebAuthnChallenge(uuid: string, origin: string): Promise<import("axios").AxiosResponse<any, any>>;
71
+ registerWebAuthnCredential(uuid: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
72
+ createLoginWebAuthnChallenge(origin: string): Promise<import("axios").AxiosResponse<any, any>>;
73
+ loginWithWebAuthnCredential(params: any): Promise<import("axios").AxiosResponse<any, any>>;
74
+ deleteWebAuthnCredential(uuid: string, id: string): Promise<import("axios").AxiosResponse<any, any>>;
75
+ listWebAuthnCredentials(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
76
+ updateWebAuthnCredential(uuid: string, id: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
70
77
  }
@@ -19,6 +19,8 @@ class AuthService {
19
19
  verify_pin: '/api/users',
20
20
  forgot_pin: '/api/users',
21
21
  forgot_password_mobile: '/api/forgot_password_mobile',
22
+ webauthn_users: '/api/users',
23
+ webauthn_login: '/api/webauthn/login',
22
24
  };
23
25
  this.client = axios_1.default.create({ baseURL: config.host });
24
26
  this.client.defaults.timeout = config.timeout || 30000; // default is 30seconds
@@ -171,5 +173,33 @@ class AuthService {
171
173
  const url = `${this.config.host}/sso/${this.config.env}/jump/${this.config.product}`;
172
174
  return url;
173
175
  }
176
+ createRegisterWebAuthnChallenge(uuid, origin) {
177
+ this.setAuthToken('webauthn_users');
178
+ return this.client.get(`${this.paths.webauthn_users}/${uuid}/webauthn/challenge?origin=${origin}`);
179
+ }
180
+ registerWebAuthnCredential(uuid, params) {
181
+ this.setAuthToken('webauthn_users');
182
+ return this.client.post(`${this.paths.webauthn_users}/${uuid}/webauthn/register`, params);
183
+ }
184
+ createLoginWebAuthnChallenge(origin) {
185
+ this.setAuthToken('webauthn_login');
186
+ return this.client.get(`${this.paths.webauthn_login}/challenge?origin=${origin}`);
187
+ }
188
+ loginWithWebAuthnCredential(params) {
189
+ this.setAuthToken('webauthn_login');
190
+ return this.client.post(`${this.paths.webauthn_login}`, params);
191
+ }
192
+ deleteWebAuthnCredential(uuid, id) {
193
+ this.setAuthToken('webauthn_users');
194
+ return this.client.delete(`${this.paths.webauthn_users}/${uuid}/webauthn/${id}`);
195
+ }
196
+ listWebAuthnCredentials(uuid) {
197
+ this.setAuthToken('webauthn_users');
198
+ return this.client.get(`${this.paths.webauthn_users}/${uuid}/webauthn`);
199
+ }
200
+ updateWebAuthnCredential(uuid, id, params) {
201
+ this.setAuthToken('webauthn_users');
202
+ return this.client.put(`${this.paths.webauthn_users}/${uuid}/webauthn/${id}`, params);
203
+ }
174
204
  }
175
205
  exports.default = AuthService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webledger-auth-plugin",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "webledger auth service AdonisJS 5 login plugin",
5
5
  "main": "build/providers/AuthServiceProvider.js",
6
6
  "scripts": {