Functions -
auth
checkForScopeMatch | Check whether the scopes of the user and scopes of resource matches. |
extractUsernameAndPassword | Extracts the username and password from the credential values. |
setAuthenticationContext | Set the authentication related values (scheme, auth token) to the authentication context of the invocation context. |
setPrincipal | Set the authentication related values (user id, username, scopes, claims) to the principal of the invocation context. |
checkForScopeMatch
(string | string resourceScopes, string userScopes, string authzCacheKey, Cache? positiveAuthzCache, Cache? negativeAuthzCache)
returns booleanCheck whether the scopes of the user and scopes of resource matches.
Parameters
- resourceScopes string | string
-
Scopes of resource
- userScopes string
-
Scopes of user
- authzCacheKey string
-
Authorization cache key
- positiveAuthzCache Cache?
-
The cache for positive authorizations
- negativeAuthzCache Cache?
-
The cache for negative authorizations
-
Return Type
(boolean) true if there is a match between resource and user scopes, else false
Extracts the username and password from the credential values.
Parameters
- credential string
-
The credential values.
-
Return Type
([string, string] | Error) A
string
tuple with the extracted username and password orError
occurred while extracting credentials
Set the authentication related values (scheme, auth token) to the authentication context of the invocation context.
Parameters
- scheme string
-
Auth scheme (JWT, LDAP, OAuth2, Basic etc.)
- authToken string
-
Auth token (credential)
Set the authentication related values (user id, username, scopes, claims) to the principal of the invocation context.
Parameters
- userId string (default ())
-
User Id of the authenticated user.
- username string (default ())
-
Username of the authenticated user.
- scopes string (default ())
-
Authenticated user scopes.
- claims map (default ())
-
Claims of the authenticated user.