Class: TokenService
backend-services/token.service.TokenService
Constructors
constructor
• new TokenService(backendJwtService
, activeLoginService
, loginUserService
)
Parameters
Name | Type |
---|---|
backendJwtService | JwtService |
activeLoginService | ActiveLoginService |
loginUserService | LoginUserService |
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
Name | Type |
---|---|
codeVerifier | string |
Returns
string
Defined in
gropius-login-service/backend/src/backend-services/token.service.ts:146
signAccessToken
▸ signAccessToken(user
, scope
, expiresIn?
): Promise
<string
>
Parameters
Name | Type |
---|---|
user | LoginUser |
scope | string [] |
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
Name | Type |
---|---|
activeLoginId | string |
clientId | string |
uniqueId | string | number |
scope | TokenScope [] |
expiresInAt | number | Date |
codeChallenge | string |
Returns
Promise
<string
>
Defined in
gropius-login-service/backend/src/backend-services/token.service.ts:68
signRegistrationToken
▸ signRegistrationToken(activeLoginId
, expiresIn?
): Promise
<string
>
Parameters
Name | Type |
---|---|
activeLoginId | string |
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
Name | Type |
---|---|
token | string |
scope | TokenScope |
Returns
Promise
<{ user
: LoginUser
}>
Defined in
gropius-login-service/backend/src/backend-services/token.service.ts:98
verifyActiveLoginToken
▸ verifyActiveLoginToken(token
, requiredClientId
): Promise
<ActiveLoginTokenResult
>
Parameters
Name | Type |
---|---|
token | string |
requiredClientId | string |
Returns
Promise
<ActiveLoginTokenResult
>
Defined in
gropius-login-service/backend/src/backend-services/token.service.ts:127
verifyRegistrationToken
▸ verifyRegistrationToken(token
): Promise
<string
>
Parameters
Name | Type |
---|---|
token | string |
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
Name | Type | Description |
---|---|---|
scopes | string [] | the scopes to verify |
Returns
void
Defined in
gropius-login-service/backend/src/backend-services/token.service.ts:160