Class Principal
- Namespace
- Amazon.Auth.AccessControlPolicy
- Assembly
- AWSSDK.Core.dll
A principal is an AWS account which is being allowed or denied access to a resource through an access control policy. The principal is a property of the Statement object, not directly the Policy object.
The principal is A in the statement "A has permission to do B to C where D applies."
In an access control policy statement, you can set the principal to all authenticated AWS users through the AllUsers member. This is useful when you don't want to restrict access based on the identity of the requester, but instead on other identifying characteristics such as the requester's IP address.
public class Principal
- Inheritance
-
Principal
- Inherited Members
Constructors
Principal(string)
Constructs a new principal with the specified AWS account ID.
public Principal(string accountId)
Parameters
accountId
stringAn AWS account ID.
Principal(string, string)
Constructs a new principal with the specified provider and id
public Principal(string provider, string id)
Parameters
provider
stringThe provider of the principal
id
stringThe unique ID of the Principal within the provider
Principal(string, string, bool)
Constructs a new principal with the specified provider and id and optionally strips hyphens from the id
public Principal(string provider, string id, bool stripHyphen)
Parameters
provider
stringThe provider of the principal
id
stringThe unique ID of the Principal within the provider
stripHyphen
boolStrip hyphen
Fields
ANONYMOUS_PROVIDER
Dummy principal provider for anonynous.
public const string ANONYMOUS_PROVIDER = "__ANONYMOUS__"
Field Value
AWS_PROVIDER
The default Principal provider for AWS accounts.
public const string AWS_PROVIDER = "AWS"
Field Value
AllUsers
Principal instance that includes all authenticated AWS users.
This is useful when you don't want to restrict access based on the identity of the requester, but instead on other identifying characteristics such as the requester's IP address.
public static readonly Principal AllUsers
Field Value
Anonymous
The anonymous Principal.
public static readonly Principal Anonymous
Field Value
CANONICAL_USER_PROVIDER
Principal provider for Canonical User IDs.
public const string CANONICAL_USER_PROVIDER = "CanonicalUser"
Field Value
FEDERATED_PROVIDER
Principal provider for federated users (using a SAML identity provider)
public const string FEDERATED_PROVIDER = "Federated"
Field Value
SERVICE_PROVIDER
Principal provider for assume role policies that will be assumed by an AWS service (e.g. "ec2.amazonaws.com").
public const string SERVICE_PROVIDER = "Service"
Field Value
Properties
Id
Gets the unique ID for this principal.
public string Id { get; }
Property Value
Provider
Gets and sets the provider for this principal, which indicates in what group of users this principal resides.
public string Provider { get; set; }