Class: OAuthTokenClientCredentialsMiddleware
api-oauth/oauth-token-client-credentials.middleware.OAuthTokenClientCredentialsMiddleware
Hierarchy
StateMiddleware
<{client
:AuthClient
}>↳
OAuthTokenClientCredentialsMiddleware
Constructors
constructor
• new OAuthTokenClientCredentialsMiddleware(tokenService
)
Parameters
Name | Type |
---|---|
tokenService | TokenService |
Overrides
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:12
Properties
logger
• Private
Readonly
logger: Logger
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:11
tokenService
• Private
Readonly
tokenService: TokenService
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:12
Methods
appendState
▸ Protected
appendState(res
, appendedState
): void
Parameters
Name | Type |
---|---|
res | Response <any , Record <string , any >> |
appendedState | { error? : any } | Partial <{}> & { error? : any } |
Returns
void
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:42
createAccessToken
▸ Private
createAccessToken(currentClient
, scope
): Promise
<OAuthTokenResponseDto
>
Parameters
Name | Type |
---|---|
currentClient | AuthClient |
scope | TokenScope [] |
Returns
Promise
<OAuthTokenResponseDto
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:16
createResponse
▸ Private
createResponse(client
, scope
): Promise
<OAuthTokenResponseDto
>
Parameters
Name | Type |
---|---|
client | AuthClient |
scope | TokenScope [] |
Returns
Promise
<OAuthTokenResponseDto
>
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:33
use
▸ use(req
, res
, next
): Promise
<void
>
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
next | (error? : any ) => any |
Returns
Promise
<void
>
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:8
useWithError
▸ Protected
useWithError(req
, res
, state
, error
, next
): void
Overwrite this to handle errors
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
state | { client : AuthClient } & { error? : any } |
error | any |
next | (error? : any ) => void |
Returns
void
Inherited from
Defined in
gropius-login-service/backend/src/api-oauth/StateMiddleware.ts:32
useWithState
▸ Protected
useWithState(req
, res
, state
, next
): Promise
<any
>
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
state | { client : AuthClient } & { error? : any } |
next | (error? : any ) => void |
Returns
Promise
<any
>
Overrides
Defined in
gropius-login-service/backend/src/api-oauth/oauth-token-client-credentials.middleware.ts:42