Class: Grants
Creates and checks grants.
Methods
create
▸ create(sessionId
, tokenOrTokens
, customDuration?
): Promise
<void
| void
[]>
Creates a grant for a token or array of tokens
throws
LunaSecError
Parameters
Name | Type | Description |
---|---|---|
sessionId | string | The session ID of the user to create a grant for, should match whatever your sessionIdProvider in your LunaSec Config returns |
tokenOrTokens | string | string [] | The token to create a grant for, or an array of tokens |
customDuration? | string | The time you would like the grant to last for as a string like "45s" or "1h10m30s", not to exceed the grant_maximum_time configured for the Tokenizer Backend. Omit to use the default configured time. |
Returns
Promise
<void
| void
[]>
Defined in
lunadefend/js/sdks/packages/node-sdk/src/grant-service/index.ts:80
verify
▸ verify(sessionId
, tokenOrTokens
): Promise
<void
| void
[]>
Verifies a token grant or array of token grants
throws
LunaSecError
Parameters
Name | Type |
---|---|
sessionId | string |
tokenOrTokens | string | string [] |
Returns
Promise
<void
| void
[]>
Defined in
lunadefend/js/sdks/packages/node-sdk/src/grant-service/index.ts:139
createWithAutomaticSessionId
▸ createWithAutomaticSessionId(req
, token
, customDuration?
): Promise
<void
| void
[]>
throws
LunaSecError
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
token | string | string [] |
customDuration? | string |
Returns
Promise
<void
| void
[]>
Defined in
lunadefend/js/sdks/packages/node-sdk/src/grant-service/index.ts:182
verifyWithAutomaticSessionId
▸ verifyWithAutomaticSessionId(req
, token
): Promise
<void
| void
[]>
throws
LunaSecError
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
token | string | string [] |
Returns
Promise
<void
| void
[]>
Defined in
lunadefend/js/sdks/packages/node-sdk/src/grant-service/index.ts:191