[ aws . verifiedpermissions ]
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.
See also: AWS API Documentation
is-authorized-with-token
--policy-store-id <value>
[--identity-token <value>]
[--access-token <value>]
[--action <value>]
[--resource <value>]
[--context <value>]
[--entities <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
--policy-store-id
(string)
Specifies the ID of the policy store. Policies in this policy store will be used to make an authorization decision for the input.
--identity-token
(string)
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
.
--access-token
(string)
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
(structure)
Specifies the requested action to be authorized. Is the specified principal authorized to perform this action on the specified resource.
actionType -> (string)
The type of an action.actionId -> (string)
The ID of an action.
Shorthand Syntax:
actionType=string,actionId=string
JSON Syntax:
{
"actionType": "string",
"actionId": "string"
}
--resource
(structure)
Specifies the resource for which the authorization decision is made. For example, is the principal allowed to perform the action on the resource?
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
Shorthand Syntax:
entityType=string,entityId=string
JSON Syntax:
{
"entityType": "string",
"entityId": "string"
}
--context
(tagged union structure)
Specifies additional context that can be used to make more granular authorization decisions.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:contextMap
.contextMap -> (map)
An list of attributes that are needed to successfully evaluate an authorization request. Each attribute in this array must include a map of a data type and its value.
Example:
"contextMap":{"<KeyName1>":{"boolean":true},"<KeyName2>":{"long":1234}}
key -> (string)
value -> (tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
An attribute value of Set type.
Example:
{"set": [ {} ] }
(tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
( … recursive … )
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
value -> (tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
( … recursive … )
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
JSON Syntax:
{
"contextMap": {"string": {
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{ ... recursive ... }
...
],
"record": {"string": { ... recursive ... }
...},
"ipaddr": "string",
"decimal": "string"
}
...
],
"record": {"string": {
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{ ... recursive ... }
...
],
"record": {"string": { ... recursive ... }
...},
"ipaddr": "string",
"decimal": "string"
}
...},
"ipaddr": "string",
"decimal": "string"
}
...}
}
--entities
(tagged union structure)
Specifies the list of resources and their associated attributes that Verified Permissions can examine when evaluating the policies.
Warning
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
IsAuthorizedWithToken
operation takes principal attributes from ** only ** theidentityToken
oraccessToken
passed to the operation.- For action entities, you can include only their
Identifier
andEntityType
.Note
This is a Tagged Union structure. Only one of the following top level keys can be set:entityList
.entityList -> (list)
An array of entities that are needed to successfully evaluate an authorization request. Each entity in this array must include an identifier for the entity, the attributes of the entity, and a list of any parent entities.
(structure)
Contains information about an entity that can be referenced in a Cedar policy.
This data type is used as one of the fields in the EntitiesDefinition structure.
{ "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" } ] }
identifier -> (structure)
The identifier of the entity.
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
attributes -> (map)
A list of attributes for the entity.
key -> (string)
value -> (tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
An attribute value of Set type.
Example:
{"set": [ {} ] }
(tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
( … recursive … )
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
value -> (tagged union structure)
The value of an attribute.
Contains information about the runtime context for a request for which an authorization decision is made.
This data type is used as a member of the ContextDefinition structure which is uses as a request parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set:boolean
,entityIdentifier
,long
,string
,set
,record
,ipaddr
,decimal
.boolean -> (boolean)
An attribute value of Boolean type.
Example:
{"boolean": true}
entityIdentifier -> (structure)
An attribute value of type EntityIdentifier .
Example:
"entityIdentifier": { "entityId": "<id>", "entityType": "<entity type>"}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
long -> (long)
An attribute value of Long type.
Example:
{"long": 0}
string -> (string)
An attribute value of String type.
Example:
{"string": "abc"}
set -> (list)
record -> (map)
An attribute value of Record type.
Example:
{"record": { "keyName": {} } }
key -> (string)
( … recursive … )
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
ipaddr -> (string)
An attribute value of ipaddr type.
Example:
{"ip": "192.168.1.100"}
decimal -> (string)
An attribute value of decimal type.
Example:
{"decimal": "1.1"}
parents -> (list)
The parent entities in the hierarchy that contains the entity. A principal or resource entity can be defined with at most 99 transitive parents per authorization request.
A transitive parent is an entity in the hierarchy of entities including all direct parents, and parents of parents. For example, a user can be a member of 91 groups if one of those groups is a member of eight groups, for a total of 100: one entity, 91 entity parents, and eight parents of parents.
(structure)
Contains the identifier of an entity, including its ID and type.
This data type is used as a request parameter for IsAuthorized operation, and as a response parameter for the CreatePolicy , GetPolicy , and UpdatePolicy operations.
Example:
{"entityId":"*string* ","entityType":"*string* "}
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "
JSON Syntax:
{
"entityList": [
{
"identifier": {
"entityType": "string",
"entityId": "string"
},
"attributes": {"string": {
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{ ... recursive ... }
...
],
"record": {"string": { ... recursive ... }
...},
"ipaddr": "string",
"decimal": "string"
}
...
],
"record": {"string": {
"boolean": true|false,
"entityIdentifier": {
"entityType": "string",
"entityId": "string"
},
"long": long,
"string": "string",
"set": [
{ ... recursive ... }
...
],
"record": {"string": { ... recursive ... }
...},
"ipaddr": "string",
"decimal": "string"
}
...},
"ipaddr": "string",
"decimal": "string"
}
...},
"parents": [
{
"entityType": "string",
"entityId": "string"
}
...
]
}
...
]
}
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug
(boolean)
Turn on debug logging.
--endpoint-url
(string)
Override command’s default URL with the given URL.
--no-verify-ssl
(boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate
(boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output
(string)
The formatting style for command output.
--query
(string)
A JMESPath query to use in filtering the response data.
--profile
(string)
Use a specific profile from your credential file.
--region
(string)
The region to use. Overrides config/env settings.
--version
(string)
Display the version of this tool.
--color
(string)
Turn on/off color output.
--no-sign-request
(boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle
(string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout
(int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout
(int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format
(string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb://
will always be treated as binary and use the file contents directly regardless of the cli-binary-format
setting. When using file://
the file contents will need to properly formatted for the configured cli-binary-format
.
--no-cli-pager
(boolean)
Disable cli pager for output.
--cli-auto-prompt
(boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt
(boolean)
Disable automatically prompt for CLI input parameters.
To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.
Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .
Example 1: To request an authorization decision for a user request (allow)
The following is-authorized-with-token
example requests an authorization decision for a user who was authenticated by Amazon Cognito. The request uses the identity token provided by Cognito rather than the access token. In this example, the specified information store is configured to return principals as entities of type CognitoUser
.
aws verifiedpermissions is-authorized-with-token \
--action actionId="View",actionType="Action" \
--resource entityId="vacationPhoto94.jpg",entityType="Photo" \
--policy-store-id PSEXAMPLEabcdefg111111 \
--identity-token "AbCdE12345...long.string...54321EdCbA"
The policy store contains a policy with the following statement that accepts identities from the specified Cognito user pool and application Id.
permit(
principal == CognitoUser::"us-east-1_1a2b3c4d5|a1b2c3d4e5f6g7h8i9j0kalbmc",
action,
resource == Photo::"VacationPhoto94.jpg"
);
Output:
{
"decision":"Allow",
"determiningPolicies":[
{
"determiningPolicyId":"SPEXAMPLEabcdefg111111"
}
],
"errors":[]
}
For more information about using identities from a Cognito user pool, see Using Amazon Verified Permissions with identity providers in the Amazon Verified Permissions User Guide.
decision -> (string)
An authorization decision that indicates if the authorization request should be allowed or denied.
determiningPolicies -> (list)
The list of determining policies used to make the authorization decision. For example, if there are multiple matching policies, where at least one is a forbid policy, then because forbid always overrides permit the forbid policies are the determining policies. If all matching policies are permit policies, then those policies are the determining policies. When no policies match and the response is the default DENY, there are no determining policies.
(structure)
Contains information about one of the policies that determined an authorization decision.
This data type is used as an element in a response parameter for the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
Example:
"determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}]
policyId -> (string)
The Id of a policy that determined to an authorization decision.
Example:
"policyId":"SPEXAMPLEabcdefg111111"
errors -> (list)
Errors that occurred while making an authorization decision. For example, a policy references an entity or entity attribute that does not exist in the slice.
(structure)
Contains a description of an evaluation error.
This data type is a response parameter of the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.
errorDescription -> (string)
The error description.
principal -> (structure)
The identifier of the principal in the ID or access token.
entityType -> (string)
The type of an entity.
Example:
"entityType":"*typeName* "
entityId -> (string)
The identifier of an entity.
"entityId":"*identifier* "