UNPKG

@loopback/docs

Version:
1,347 lines (1,346 loc) 76.9 kB
{ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "7.7.8", "schemaVersion": 1003, "oldestForwardsCompatibleVersion": 1001 }, "kind": "Package", "canonicalReference": "@loopback/authentication!", "docComment": "", "name": "@loopback/authentication", "members": [ { "kind": "EntryPoint", "canonicalReference": "@loopback/authentication!", "name": "", "members": [ { "kind": "Function", "canonicalReference": "@loopback/authentication!authenticate:function(1)", "docComment": "/**\n * Mark a controller method as requiring authenticated user.\n *\n * @param strategyNameOrMetadata - The name of the authentication strategy to use or the authentication metadata object.\n *\n * @param options - Additional options to configure the authentication.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function authenticate(strategyNameOrMetadata: " }, { "kind": "Content", "text": "string | " }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": ", options?: " }, { "kind": "Content", "text": "object" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "(target: any, method?: string | undefined, methodDescriptor?: " }, { "kind": "Reference", "text": "TypedPropertyDescriptor", "canonicalReference": "!TypedPropertyDescriptor:interface" }, { "kind": "Content", "text": "<any> | undefined) => any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 6, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "strategyNameOrMetadata", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "parameterName": "options", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 } } ], "name": "authenticate" }, { "kind": "Namespace", "canonicalReference": "@loopback/authentication!authenticate:namespace", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare namespace authenticate " } ], "releaseTag": "Public", "name": "authenticate", "members": [ { "kind": "Variable", "canonicalReference": "@loopback/authentication!authenticate.skip:var", "docComment": "/**\n * `@authenticate.skip()` - a sugar decorator to skip authentication\n */\n", "excerptTokens": [ { "kind": "Content", "text": "skip: " }, { "kind": "Content", "text": "() => (target: any, method?: string | undefined, methodDescriptor?: " }, { "kind": "Reference", "text": "TypedPropertyDescriptor", "canonicalReference": "!TypedPropertyDescriptor:interface" }, { "kind": "Content", "text": "<any> | undefined) => any" } ], "releaseTag": "Public", "name": "skip", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ] }, { "kind": "Class", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider:class", "docComment": "/**\n * Provides the authentication action for a sequence\n *\n * @example\n *\n * `context.bind('authentication.actions.authenticate').toProvider(AuthenticateActionProvider)`\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class AuthenticateActionProvider implements " }, { "kind": "Reference", "text": "Provider", "canonicalReference": "@loopback/context!Provider:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticateFn", "canonicalReference": "@loopback/authentication!AuthenticateFn:interface" }, { "kind": "Content", "text": "> " } ], "releaseTag": "Public", "name": "AuthenticateActionProvider", "members": [ { "kind": "Constructor", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `AuthenticateActionProvider` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(getStrategy: " }, { "kind": "Reference", "text": "Getter", "canonicalReference": "@loopback/context!Getter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ", setCurrentUser: " }, { "kind": "Reference", "text": "Setter", "canonicalReference": "@loopback/context!Setter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "getStrategy", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "parameterName": "setCurrentUser", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 10 } } ] }, { "kind": "Method", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider#action:member(1)", "docComment": "/**\n * The implementation of authenticate() sequence action.\n *\n * @param request - The incoming request provided by the REST layer\n */\n", "excerptTokens": [ { "kind": "Content", "text": "action(request: " }, { "kind": "Reference", "text": "Request", "canonicalReference": "@types/express!~e.Request:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": " | undefined>" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "request", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "action" }, { "kind": "Property", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider#getStrategy:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly getStrategy: " }, { "kind": "Reference", "text": "Getter", "canonicalReference": "@loopback/context!Getter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "getStrategy", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider#setCurrentUser:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "readonly setCurrentUser: " }, { "kind": "Reference", "text": "Setter", "canonicalReference": "@loopback/context!Setter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": ">" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "setCurrentUser", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@loopback/authentication!AuthenticateActionProvider#value:member(1)", "docComment": "/**\n * @returns authenticateFn\n */\n", "excerptTokens": [ { "kind": "Content", "text": "value(): " }, { "kind": "Reference", "text": "AuthenticateFn", "canonicalReference": "@loopback/authentication!AuthenticateFn:interface" }, { "kind": "Content", "text": ";" } ], "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "value" } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 5 } ] }, { "kind": "Interface", "canonicalReference": "@loopback/authentication!AuthenticateFn:interface", "docComment": "/**\n * interface definition of a function which accepts a request and returns an authenticated user\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface AuthenticateFn " } ], "releaseTag": "Public", "name": "AuthenticateFn", "members": [ { "kind": "CallSignature", "canonicalReference": "@loopback/authentication!AuthenticateFn:call(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "(request: " }, { "kind": "Reference", "text": "Request", "canonicalReference": "@types/express!~e.Request:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": " | undefined>" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "request", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ] } ], "extendsTokenRanges": [] }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AUTHENTICATION_METADATA_CLASS_KEY:var", "docComment": "/**\n * The key used to store class-level metadata for `@authenticate`\n */\n", "excerptTokens": [ { "kind": "Content", "text": "AUTHENTICATION_METADATA_CLASS_KEY: " }, { "kind": "Reference", "text": "MetadataAccessor", "canonicalReference": "@loopback/metadata!MetadataAccessor:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "ClassDecorator", "canonicalReference": "!ClassDecorator:type" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "AUTHENTICATION_METADATA_CLASS_KEY", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 7 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AUTHENTICATION_METADATA_KEY:var", "docComment": "/**\n * Alias for AUTHENTICATION_METADATA_METHOD_KEY to keep it backward compatible\n */\n", "excerptTokens": [ { "kind": "Content", "text": "AUTHENTICATION_METADATA_KEY: " }, { "kind": "Reference", "text": "MetadataAccessor", "canonicalReference": "@loopback/metadata!MetadataAccessor:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "MethodDecorator", "canonicalReference": "!MethodDecorator:type" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "AUTHENTICATION_METADATA_KEY", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 7 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AUTHENTICATION_METADATA_METHOD_KEY:var", "docComment": "/**\n * The key used to store method-level metadata for `@authenticate`\n */\n", "excerptTokens": [ { "kind": "Content", "text": "AUTHENTICATION_METADATA_METHOD_KEY: " }, { "kind": "Reference", "text": "MetadataAccessor", "canonicalReference": "@loopback/metadata!MetadataAccessor:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "MethodDecorator", "canonicalReference": "!MethodDecorator:type" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "AUTHENTICATION_METADATA_METHOD_KEY", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 7 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AUTHENTICATION_STRATEGY_NOT_FOUND:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "AUTHENTICATION_STRATEGY_NOT_FOUND = \"AUTHENTICATION_STRATEGY_NOT_FOUND\"" } ], "releaseTag": "Public", "name": "AUTHENTICATION_STRATEGY_NOT_FOUND", "variableTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "kind": "Namespace", "canonicalReference": "@loopback/authentication!AuthenticationBindings:namespace", "docComment": "/**\n * Binding keys used by this component.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare namespace AuthenticationBindings " } ], "releaseTag": "Public", "name": "AuthenticationBindings", "members": [ { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.AUTH_ACTION:var", "docComment": "/**\n * Key used to inject the authentication function into the sequence.\n *\n * @example\n * ```ts\n * class MySequence implements SequenceHandler {\n * constructor(\n * @inject(AuthenticationBindings.AUTH_ACTION)\n * protected authenticateRequest: AuthenticateFn,\n * // ... other sequence action injections\n * ) {}\n *\n * async handle(context: RequestContext) {\n * try {\n * const {request, response} = context;\n * const route = this.findRoute(request);\n *\n * // Authenticate\n * await this.authenticateRequest(request);\n *\n * // Authentication successful, proceed to invoke controller\n * const args = await this.parseParams(request, route);\n * const result = await this.invoke(route, args);\n * this.send(response, result);\n * } catch (err) {\n * this.reject(context, err);\n * }\n * }\n * }\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "AUTH_ACTION: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticateFn", "canonicalReference": "@loopback/authentication!AuthenticateFn:interface" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "AUTH_ACTION", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME = \"authentication.strategies\"" } ], "releaseTag": "Public", "name": "AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME", "variableTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.COMPONENT:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "COMPONENT: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationComponent", "canonicalReference": "@loopback/authentication!AuthenticationComponent:class" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "COMPONENT", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.CURRENT_USER:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "CURRENT_USER: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<import(\"@loopback/security\")." }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": ">" } ], "releaseTag": "Public", "name": "CURRENT_USER", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.METADATA:var", "docComment": "/**\n * Key used to inject authentication metadata, which is used to determine whether a request requires authentication or not.\n *\n * @example\n * ```ts\n * class MyPassportStrategyProvider implements Provider<Strategy | undefined> {\n * constructor(\n * @inject(AuthenticationBindings.METADATA)\n * private metadata: AuthenticationMetadata,\n * ) {}\n * value(): ValueOrPromise<Strategy | undefined> {\n * if (this.metadata) {\n * const name = this.metadata.strategy;\n * // logic to determine which authentication strategy to return\n * }\n * }\n * }\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "METADATA: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": " | undefined>" } ], "releaseTag": "Public", "name": "METADATA", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.STRATEGY:var", "docComment": "/**\n * Key used to bind an authentication strategy to the context for the authentication function to use.\n *\n * @example\n * ```ts\n * server\n * .bind(AuthenticationBindings.STRATEGY)\n * .toProvider(MyAuthenticationStrategy);\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "STRATEGY: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": " | undefined>" } ], "releaseTag": "Public", "name": "STRATEGY", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "Variable", "canonicalReference": "@loopback/authentication!AuthenticationBindings.USER_PROFILE_FACTORY:var", "docComment": "/**\n * Key used to bind a user profile factory to the context for any consumer to use when they need to convert a user object into a slimmer user profile object\n *\n * @example\n * ```ts\n * server\n * .bind(AuthenticationBindings.USER_PROFILE_FACTORY)\n * .to(myUserProfileFactory);\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", "text": "USER_PROFILE_FACTORY: " }, { "kind": "Reference", "text": "BindingKey", "canonicalReference": "@loopback/context!BindingKey:class" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfileFactory", "canonicalReference": "@loopback/authentication!UserProfileFactory:interface" }, { "kind": "Content", "text": "<any>>" } ], "releaseTag": "Public", "name": "USER_PROFILE_FACTORY", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 5 } } ] }, { "kind": "Class", "canonicalReference": "@loopback/authentication!AuthenticationComponent:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class AuthenticationComponent implements " }, { "kind": "Reference", "text": "Component", "canonicalReference": "@loopback/core!Component:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "AuthenticationComponent", "members": [ { "kind": "Constructor", "canonicalReference": "@loopback/authentication!AuthenticationComponent:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `AuthenticationComponent` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor();" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [] }, { "kind": "Property", "canonicalReference": "@loopback/authentication!AuthenticationComponent#providers:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "providers?: " }, { "kind": "Reference", "text": "ProviderMap", "canonicalReference": "@loopback/core!ProviderMap:interface" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "providers", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 3 } ] }, { "kind": "Interface", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface", "docComment": "/**\n * Authentication metadata stored via Reflection API\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface AuthenticationMetadata " } ], "releaseTag": "Public", "name": "AuthenticationMetadata", "members": [ { "kind": "PropertySignature", "canonicalReference": "@loopback/authentication!AuthenticationMetadata#options:member", "docComment": "/**\n * Options for the authentication strategy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "options?: " }, { "kind": "Content", "text": "{\n [name: string]: any;\n }" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "options", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@loopback/authentication!AuthenticationMetadata#skip:member", "docComment": "/**\n * A flag to skip authentication\n */\n", "excerptTokens": [ { "kind": "Content", "text": "skip?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "skip", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@loopback/authentication!AuthenticationMetadata#strategy:member", "docComment": "/**\n * Name of the authentication strategy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "strategy: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "strategy", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@loopback/authentication!AuthenticationOptions:interface", "docComment": "/**\n * Options for authentication component\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface AuthenticationOptions " } ], "releaseTag": "Public", "name": "AuthenticationOptions", "members": [ { "kind": "PropertySignature", "canonicalReference": "@loopback/authentication!AuthenticationOptions#defaultMetadata:member", "docComment": "/**\n * Default authentication metadata if a method or class is not decorated with `@authenticate`. If not set, no default authentication will be enforced for those methods without authentication metadata.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "defaultMetadata?: " }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "defaultMetadata", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface", "docComment": "/**\n * An interface that describes the common authentication strategy.\n *\n * An authentication strategy is a class with an 'authenticate' method that verifies a user's credentials and returns the corresponding user profile.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface AuthenticationStrategy " } ], "releaseTag": "Public", "name": "AuthenticationStrategy", "members": [ { "kind": "MethodSignature", "canonicalReference": "@loopback/authentication!AuthenticationStrategy#authenticate:member(1)", "docComment": "/**\n * The 'authenticate' method takes in a given request and returns a user profile which is an instance of 'UserProfile'. (A user profile is a minimal subset of a user object) If the user credentials are valid, this method should return a 'UserProfile' instance. If the user credentials are invalid, this method should throw an error If the user credentials are missing, this method should throw an error, or return 'undefined' and let the authentication action deal with it.\n *\n * @param request - Express request object\n */\n", "excerptTokens": [ { "kind": "Content", "text": "authenticate(request: " }, { "kind": "Reference", "text": "Request", "canonicalReference": "@types/express!~e.Request:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "UserProfile", "canonicalReference": "@loopback/security!UserProfile:interface" }, { "kind": "Content", "text": " | undefined>" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "request", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "authenticate" }, { "kind": "PropertySignature", "canonicalReference": "@loopback/authentication!AuthenticationStrategy#name:member", "docComment": "/**\n * The 'name' property is a unique identifier for the authentication strategy ( for example : 'basic', 'jwt', etc)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Class", "canonicalReference": "@loopback/authentication!AuthenticationStrategyProvider:class", "docComment": "/**\n * An authentication strategy provider responsible for resolving an authentication strategy by name.\n *\n * It declares an extension point to which all authentication strategy implementations must register themselves as extensions.\n *\n * @example\n *\n * `context.bind('authentication.strategy').toProvider(AuthenticationStrategyProvider)`\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class AuthenticationStrategyProvider implements " }, { "kind": "Reference", "text": "Provider", "canonicalReference": "@loopback/context!Provider:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": " | undefined> " } ], "releaseTag": "Public", "name": "AuthenticationStrategyProvider", "members": [ { "kind": "Constructor", "canonicalReference": "@loopback/authentication!AuthenticationStrategyProvider:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `AuthenticationStrategyProvider` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(authenticationStrategies: " }, { "kind": "Reference", "text": "Getter", "canonicalReference": "@loopback/context!Getter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": "[]>" }, { "kind": "Content", "text": ", metadata?: " }, { "kind": "Reference", "text": "AuthenticationMetadata", "canonicalReference": "@loopback/authentication!AuthenticationMetadata:interface" }, { "kind": "Content", "text": " | undefined" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "authenticationStrategies", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "parameterName": "metadata", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 8 } } ] }, { "kind": "Property", "canonicalReference": "@loopback/authentication!AuthenticationStrategyProvider#authenticationStrategies:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "protected authenticationStrategies: " }, { "kind": "Reference", "text": "Getter", "canonicalReference": "@loopback/context!Getter:type" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface" }, { "kind": "Content", "text": "[]>" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "authenticationStrategies", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@loopback/authentication!AuthenticationStrategyProvider#findAuthenticationStrategy:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "findAuthenticationStrategy(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Promise", "canonicalReference": "!Promise:interface" }, { "kind": "Content", "text": "<" }, { "kind": "Reference", "text": "AuthenticationStrategy", "canonicalReference": "@loopback/authentication!AuthenticationStrategy:interface"