1 | import { AuthenticationBase, AuthenticationResult, AuthenticationRequest } from './core';
|
2 | import '@feathersjs/transport-commons';
|
3 | import { Application, Params, ServiceMethods, ServiceAddons } from '@feathersjs/feathers';
|
4 | declare module '@feathersjs/feathers' {
|
5 | interface Application<ServiceTypes = {}> {
|
6 | |
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | defaultAuthentication(location?: string): AuthenticationService;
|
13 | }
|
14 | interface Params {
|
15 | authenticated?: boolean;
|
16 | authentication?: AuthenticationRequest;
|
17 | }
|
18 | }
|
19 | export interface AuthenticationService extends ServiceAddons<AuthenticationResult> {
|
20 | }
|
21 | export declare class AuthenticationService extends AuthenticationBase implements Partial<ServiceMethods<AuthenticationResult>> {
|
22 | constructor(app: Application, configKey?: string, options?: {});
|
23 | /**
|
24 | * Return the payload for a JWT based on the authentication result.
|
25 | * Called internally by the `create` method.
|
26 | * @param _authResult The current authentication result
|
27 | * @param params The service call parameters
|
28 | */
|
29 | getPayload(_authResult: AuthenticationResult, params: Params): Promise<any>;
|
30 | /**
|
31 | * Returns the JWT options based on an authentication result.
|
32 | * By default sets the JWT subject to the entity id.
|
33 | * @param authResult The authentication result
|
34 | * @param params Service call parameters
|
35 | */
|
36 | getTokenOptions(authResult: AuthenticationResult, params: Params): Promise<any>;
|
37 | /**
|
38 | * Create and return a new JWT for a given authentication request.
|
39 | * Will trigger the `login` event.
|
40 | * @param data The authentication request (should include `strategy` key)
|
41 | * @param params Service call parameters
|
42 | */
|
43 | create(data: AuthenticationRequest, params: Params): Promise<AuthenticationResult>;
|
44 | /**
|
45 | * Mark a JWT as removed. By default only verifies the JWT and returns the result.
|
46 | * Triggers the `logout` event.
|
47 | * @param id The JWT to remove or null
|
48 | * @param params Service call parameters
|
49 | */
|
50 | remove(id: string | null, params: Params): Promise<AuthenticationResult>;
|
51 | /**
|
52 | * Validates the service configuration.
|
53 | */
|
54 | setup(): void;
|
55 | }
|