Abstract Class: BaseAuthOIDCRoute<U, A, P>
Defined in: src/routes/BaseAuthOIDCRoute.ts:46
IMPORTANT!! A subclass using a non-default strategyName (see its own doc comment — required for a
multi-provider setup) MUST override this method with a matching @Auth([...]), delegating
to super.login(...) for the actual token issuance, e.g.:
protected strategyName = "google";
@Auth(["google"])
public override async login(@User user: JWTUser, @Request req: HttpRequest, @Response res: HttpResponse) {
return super.login(user, req, res);
}
@Auth([...])'s strategy list is read from decorator metadata attached to the declaring
class at load time, not re-evaluated per instance — a subclass that doesn't redeclare
login() inherits this base implementation's @Auth(["oauth"]) regardless of its own
strategyName.
Extended by
Type Parameters
U
U extends User
A
A extends Alias
P
P extends Profile
Constructors
Constructor
new BaseAuthOIDCRoute<
U,A,P>():BaseAuthOIDCRoute<U,A,P>
Returns
BaseAuthOIDCRoute<U, A, P>
Properties
aliasClass
abstractprotectedaliasClass:any
Defined in: src/routes/BaseAuthOIDCRoute.ts:47
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<A>
Defined in: src/routes/BaseAuthOIDCRoute.ts:54
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: src/routes/BaseAuthOIDCRoute.ts:57
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: src/routes/BaseAuthOIDCRoute.ts:60
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAuthOIDCRoute.ts:63
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAuthOIDCRoute.ts:66
profileClass
abstractprotectedprofileClass:any
Defined in: src/routes/BaseAuthOIDCRoute.ts:48
profileRepo?
protectedoptionalprofileRepo?:RepoUtils<P>
Defined in: src/routes/BaseAuthOIDCRoute.ts:68
providerConfig
abstractprotectedproviderConfig:OIDCProvider
Defined in: src/routes/BaseAuthOIDCRoute.ts:70
strategyName
protectedstrategyName:string="oauth"
Defined in: src/routes/BaseAuthOIDCRoute.ts:81
The name this route's strategy registers under in AuthMiddleware, and the name login()'s
@Auth([...]) must match. Defaults to "oauth" for backward compatibility with a
single-provider setup. An app wiring up more than one BaseAuthOIDCRoute subclass (e.g. one
per third-party provider) MUST give each a distinct strategyName and override login()
with a matching @Auth([...]) — otherwise every subclass registers under the same shared
name and the last one loaded silently wins for all of them. See login()'s own doc comment
for the override pattern.
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: src/routes/BaseAuthOIDCRoute.ts:84
userClass
abstractprotecteduserClass:any
Defined in: src/routes/BaseAuthOIDCRoute.ts:49
userRepo?
protectedoptionaluserRepo?:RepoUtils<U>
Defined in: src/routes/BaseAuthOIDCRoute.ts:86
userUtils?
protectedoptionaluserUtils?:UserUtils<U,A>
Defined in: src/routes/BaseAuthOIDCRoute.ts:88
Methods
login()
login(
user,req,res):Promise<AuthResult|undefined>
Defined in: src/routes/BaseAuthOIDCRoute.ts:311
Authenticates the user using OIDC and returns a JSON Web Token access token to be used with future API requests.
A request with no code redirects the browser to the provider's authorization page by default;
pass ?no_redirect=true to receive { url } as JSON instead (see OIDCStrategy.authenticate())
— lets a JS-driven frontend fetch the URL itself and treat a failure to build it as a normal API
error it can render, rather than the browser landing on a raw response after an automatic redirect.
Parameters
user
JWTUser
req
HttpRequest
res
HttpResponse
Returns
Promise<AuthResult | undefined>