Skip to main content

Class: TokenService

backend-services/token.service.TokenService

Constructors

constructor

new TokenService(backendJwtService, activeLoginService, loginUserService)

Parameters

NameType
backendJwtServiceJwtService
activeLoginServiceActiveLoginService
loginUserServiceLoginUserService

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:30

Properties

activeLoginService

Private Readonly activeLoginService: ActiveLoginService

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:33


backendJwtService

Private Readonly backendJwtService: JwtService

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:32


loginUserService

Private Readonly loginUserService: LoginUserService

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:34

Methods

calculateCodeChallenge

calculateCodeChallenge(codeVerifier): string

Parameters

NameType
codeVerifierstring

Returns

string

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:146


signAccessToken

signAccessToken(user, scope, expiresIn?): Promise<string>

Parameters

NameType
userLoginUser
scopestring[]
expiresIn?number

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:37


signActiveLoginCode

signActiveLoginCode(activeLoginId, clientId, uniqueId, scope, expiresInAt, codeChallenge): Promise<string>

Parameters

NameType
activeLoginIdstring
clientIdstring
uniqueIdstring | number
scopeTokenScope[]
expiresInAtnumber | Date
codeChallengestring

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:68


signRegistrationToken

signRegistrationToken(activeLoginId, expiresIn?): Promise<string>

Parameters

NameType
activeLoginIdstring
expiresIn?number

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:56


verifyAccessToken

verifyAccessToken(token, scope): Promise<{ user: LoginUser }>

Parameters

NameType
tokenstring
scopeTokenScope

Returns

Promise<{ user: LoginUser }>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:98


verifyActiveLoginToken

verifyActiveLoginToken(token, requiredClientId): Promise<ActiveLoginTokenResult>

Parameters

NameType
tokenstring
requiredClientIdstring

Returns

Promise<ActiveLoginTokenResult>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:127


verifyRegistrationToken

verifyRegistrationToken(token): Promise<string>

Parameters

NameType
tokenstring

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:120


verifyScope

verifyScope(scopes): void

Verifies that the given combination of scopes is valid.

Parameters

NameTypeDescription
scopesstring[]the scopes to verify

Returns

void

Defined in

gropius-login-service/backend/src/backend-services/token.service.ts:160