Makes an authorization decision about a service request described in the parameters¶
Description¶
Makes an authorization decision about a service request described in the parameters. The principal in this request comes from an external identity source in the form of an identity token formatted as a JSON web token (JWT). The information in the parameters can also define additional context that Verified Permissions can include in the evaluation. The request is evaluated against all matching policies in the specified policy store. The result of the decision is either Allow or Deny, along with a list of the policies that resulted in the decision.
Verified Permissions validates each token that is specified in a request by checking its expiration date and its signature.
Tokens from an identity source user continue to be usable until they expire. Token revocation and resource deletion have no effect on the validity of a token in your policy store
Usage¶
verifiedpermissions_is_authorized_with_token(policyStoreId,
identityToken, accessToken, action, resource, context, entities)
Arguments¶
-
policyStoreId[required] Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.
To specify a policy store, use its ID or alias name. When using an alias name, prefix it with
policy-store-alias/. For example:- ID:
PSEXAMPLEabcdefg111111 - Alias name:
policy-store-alias/example-policy-store
To view aliases, use
list_policy_store_aliases. - ID:
-
identityTokenSpecifies an identity token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an
accessToken, anidentityToken, or both.Must be an ID token. Verified Permissions returns an error if the
token_useclaim in the submitted token isn'tid. -
accessTokenSpecifies an access token for the principal to be authorized. This token is provided to you by the identity provider (IdP) associated with the specified identity source. You must specify either an
accessToken, anidentityToken, or both.Must be an access token. Verified Permissions returns an error if the
token_useclaim in the submitted token isn'taccess. -
actionSpecifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource.
-
resourceSpecifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource?
-
contextSpecifies additional context that can be used to make more granular authorization decisions.
-
entities(Optional) Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies. These additional entities and their attributes can be referenced and checked by conditional elements in the policies in the specified policy store.
You can't include principals in this parameter, only resource and action entities. This parameter can't include any entities of a type that matches the user or group entity types that you defined in your identity source.
- The
is_authorized_with_tokenoperation takes principal attributes from only theidentityTokenoraccessTokenpassed to the operation. - For action entities, you can include only their
IdentifierandEntityType.
- The
Value¶
A list with the following syntax:
list(
decision = "ALLOW"|"DENY",
determiningPolicies = list(
list(
policyId = "string"
)
),
errors = list(
list(
errorDescription = "string"
)
),
principal = list(
entityType = "string",
entityId = "string"
)
)
Request syntax¶
svc$is_authorized_with_token(
policyStoreId = "string",
identityToken = "string",
accessToken = "string",
action = list(
actionType = "string",
actionId = "string"
),
resource = list(
entityType = "string",
entityId = "string"
),
context = list(
contextMap = list(
list(
boolean = TRUE|FALSE,
entityIdentifier = list(
entityType = "string",
entityId = "string"
),
long = 123,
string = "string",
set = list(
list()
),
record = list(
list()
),
ipaddr = "string",
decimal = "string",
datetime = "string",
duration = "string"
)
),
cedarJson = "string"
),
entities = list(
entityList = list(
list(
identifier = list(
entityType = "string",
entityId = "string"
),
attributes = list(
list(
boolean = TRUE|FALSE,
entityIdentifier = list(
entityType = "string",
entityId = "string"
),
long = 123,
string = "string",
set = list(
list()
),
record = list(
list()
),
ipaddr = "string",
decimal = "string",
datetime = "string",
duration = "string"
)
),
parents = list(
list(
entityType = "string",
entityId = "string"
)
),
tags = list(
list(
boolean = TRUE|FALSE,
entityIdentifier = list(
entityType = "string",
entityId = "string"
),
long = 123,
string = "string",
set = list(
list()
),
record = list(
list()
),
ipaddr = "string",
decimal = "string",
datetime = "string",
duration = "string"
)
)
)
),
cedarJson = "string"
)
)