Is Authorized With Token
verifiedpermissions_is_authorized_with_token | R Documentation |
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.
At this time, Verified Permissions accepts tokens from only Amazon Cognito.
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.
identityToken
Specifies 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_use
claim in the submitted token isn'tid
.accessToken
Specifies 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_use
claim in the submitted token isn'taccess
.action
Specifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource.
resource
Specifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource?
context
Specifies additional context that can be used to make more granular authorization decisions.
entities
Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.
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_token
operation takes principal attributes from only theidentityToken
oraccessToken
passed to the operation.For action entities, you can include only their
Identifier
andEntityType
.
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()
)
)
)
),
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()
)
)
),
parents = list(
list(
entityType = "string",
entityId = "string"
)
)
)
)
)
)