Abstract Class: BaseAuthOIDCRouteSQL
Defined in: src/routes/sql/BaseAuthOIDCRouteSQL.ts:8
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.
Extends
Constructors
Constructor
new BaseAuthOIDCRouteSQL():
BaseAuthOIDCRouteSQL
Returns
BaseAuthOIDCRouteSQL
Inherited from
Properties
aliasClass
protectedaliasClass:any=AliasSQL
Defined in: src/routes/sql/BaseAuthOIDCRouteSQL.ts:9
Overrides
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<AliasSQL>
Defined in: src/routes/BaseAuthOIDCRoute.ts:54
Inherited from
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: src/routes/BaseAuthOIDCRoute.ts:57
Inherited from
BaseAuthOIDCRoute.authMiddleware
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: src/routes/BaseAuthOIDCRoute.ts:60
Inherited from
BaseAuthOIDCRoute.defaultScopes
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAuthOIDCRoute.ts:63
Inherited from
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAuthOIDCRoute.ts:66
Inherited from
BaseAuthOIDCRoute.messagingUtils
profileClass
protectedprofileClass:any=ProfileSQL
Defined in: src/routes/sql/BaseAuthOIDCRouteSQL.ts:10
Overrides
BaseAuthOIDCRoute.profileClass
profileRepo?
protectedoptionalprofileRepo?:RepoUtils<ProfileSQL>
Defined in: src/routes/BaseAuthOIDCRoute.ts:68
Inherited from
providerConfig
abstractprotectedproviderConfig:OIDCProvider
Defined in: src/routes/BaseAuthOIDCRoute.ts:70
Inherited from
BaseAuthOIDCRoute.providerConfig
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.
Inherited from
BaseAuthOIDCRoute.strategyName
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: src/routes/BaseAuthOIDCRoute.ts:84
Inherited from
userClass
protecteduserClass:any=UserSQL
Defined in: src/routes/sql/BaseAuthOIDCRouteSQL.ts:11
Overrides
userRepo?
protectedoptionaluserRepo?:RepoUtils<UserSQL>
Defined in: src/routes/BaseAuthOIDCRoute.ts:86
Inherited from
userUtils?
Defined in: src/routes/BaseAuthOIDCRoute.ts:88
Inherited from
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>