AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the CreateIdentitySource operation. Adds an identity source to a policy store–an Amazon Cognito user pool or OpenID Connect (OIDC) identity provider (IdP).

After you create an identity source, you can use the identities provided by the IdP as proxies for the principal in authorization queries that use the IsAuthorizedWithToken or BatchIsAuthorizedWithToken API operations. These identities take the form of tokens that contain claims about the user, such as IDs, attributes and group memberships. Identity sources provide identity (ID) tokens and access tokens. Verified Permissions derives information about your user and session from token claims. Access tokens provide action context to your policies, and ID tokens provide principal Attributes.

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

To reference a user from this identity source in your Cedar policies, refer to the following syntax examples.

  • Amazon Cognito user pool: Namespace::[Entity type]::[User pool ID]|[user principal attribute], for example MyCorp::User::us-east-1_EXAMPLE|a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

  • OpenID Connect (OIDC) provider: Namespace::[Entity type]::[entityIdPrefix]|[user principal attribute], for example MyCorp::User::MyOIDCProvider|a1b2c3d4-5678-90ab-cdef-EXAMPLE22222.

Verified Permissions is eventually consistent. It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.VerifiedPermissions.AmazonVerifiedPermissionsRequest
      Amazon.VerifiedPermissions.Model.CreateIdentitySourceRequest

Namespace: Amazon.VerifiedPermissions.Model
Assembly: AWSSDK.VerifiedPermissions.dll
Version: 3.x.y.z

Syntax

C#
public class CreateIdentitySourceRequest : AmazonVerifiedPermissionsRequest
         IAmazonWebServiceRequest

The CreateIdentitySourceRequest type exposes the following members

Constructors

Properties

NameTypeDescription
Public Property ClientToken System.String

Gets and sets the property ClientToken.

Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value..

If you don't provide this value, then Amazon Web Services generates a random one for you.

If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an ConflictException error.

Verified Permissions recognizes a ClientToken for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of ClientToken.

Public Property Configuration Amazon.VerifiedPermissions.Model.Configuration

Gets and sets the property Configuration.

Specifies the details required to communicate with the identity provider (IdP) associated with this identity source.

Public Property PolicyStoreId System.String

Gets and sets the property PolicyStoreId.

Specifies the ID of the policy store in which you want to store this identity source. Only policies and requests made using this policy store can reference identities from the identity provider configured in the new identity source.

Public Property PrincipalEntityType System.String

Gets and sets the property PrincipalEntityType.

Specifies the namespace and data type of the principals generated for identities authenticated by the new identity source.

Examples

The following ``create-identity-source`` example creates an identity source that lets you reference identities stored in the specified Amazon Cognito user pool. Those identities are available in Verified Permissions as entities of type ``User``.

To create an identity source


var client = new AmazonVerifiedPermissionsClient();
var response = client.BatchGetPolicy(new BatchGetPolicyRequest 
{
    Requests = new List<BatchGetPolicyInputItem> {
        new BatchGetPolicyInputItem {
            PolicyId = "PWv5M6d5HePx3gVVLKY1nK",
            PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
        },
        new BatchGetPolicyInputItem {
            PolicyId = "LzFn6KgLWvv4Mbegus35jn",
            PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
        },
        new BatchGetPolicyInputItem {
            PolicyId = "77gLjer8H5o3mvrnMGrSL5",
            PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
        }
    }
});

List<BatchGetPolicyErrorItem> errors = response.Errors;
List<BatchGetPolicyOutputItem> results = response.Results;

            

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5