MCPcopy
hub / github.com/loopbackio/loopback-next / AuthenticationStrategy

Interface AuthenticationStrategy

packages/authentication/src/types.ts:82–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 *
81 */
82export interface AuthenticationStrategy {
83 /**
84 * The 'name' property is a unique identifier for the
85 * authentication strategy ( for example : 'basic', 'jwt', etc)
86 */
87 name: string;
88
89 /**
90 * The 'authenticate' method takes in a given request and returns a user profile
91 * which is an instance of 'UserProfile'.
92 * (A user profile is a minimal subset of a user object)
93 * If the user credentials are valid, this method should return a 'UserProfile' instance.
94 * If the user credentials are invalid, this method should throw an error
95 * If the user credentials are missing, this method should throw an error, or return 'undefined'
96 * and let the authentication action deal with it.
97 *
98 * @param request - Express request object
99 */
100 authenticate(
101 request: Request,
102 ): Promise<UserProfile | RedirectRoute | undefined>;
103}
104
105export const AUTHENTICATION_STRATEGY_NOT_FOUND =
106 'AUTHENTICATION_STRATEGY_NOT_FOUND';

Callers 8

actionMethod · 0.65
valueMethod · 0.65
initMethod · 0.65
syncSequelizeModelMethod · 0.65
authenticateMethod · 0.65
authenticateMethod · 0.65
valueMethod · 0.65

Implementers 15

MyAuthenticationStrategypackages/authentication/src/__tests__/
MockStrategypackages/authentication/src/__tests__/
MockStrategy2packages/authentication/src/__tests__/
BadJWTStrategypackages/authentication/src/__tests__/
BadJWTStrategypackages/authentication/src/__tests__/
BadBasicStrategypackages/authentication/src/__tests__/
BadBasicStrategypackages/authentication/src/__tests__/
JWTAuthenticationStrategypackages/authentication/src/__tests__/
BasicAuthenticationStrategypackages/authentication/src/__tests__/
JWTAuthenticationStrategyextensions/authentication-jwt/src/serv
StrategyAdapterextensions/authentication-passport/src
TwitterOauthAuthenticationexamples/passport-login/src/authentica

Calls

no outgoing calls

Tested by

no test coverage detected