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.

Registers a role-based profile to be used with SAML authentication. The profile contains details of the role to be assumed when AWS credentials are requested based on the role and a reference to a SAML endpoint profile containing details of the endpoint to be called to authenticate the user.

If user identity information is not supplied then the identity of the logged-in user will be used when authenticaton is performed against the endpoint referenced in the SAML endpoint profile. If identity is provided, no password information is stored in the role profile and the user must supply the password for the identity prior to authentication with the endpoint.

Namespace: Amazon.Util
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z


public String Persist(
         String profileName,
         String endpointSettingsName,
         String roleArn,
         String userIdentity,
         String session,
         String region
Type: System.String

Name to be assigned to the profile

Type: System.String

The name of the settings in the SAML endpoints file containing details of the endpoint to authenticate with.

Type: System.String

The arn of the role that the user wants to assume when using this profile. This must be one of the set returned by the saml endpoint when the user authenticates.

Type: System.String

Optional, can be used to prompt the user for a password for the account when authentication is performed from a system that is not domain-joined.

Type: System.String

Optional, details of the currently active credentials for the role that we want to persist into the profile for other tools or processes to pick up, avoiding the need to continually re-authenticate the user as they switch between tools. The active session, if any, is stored separately from the profile using the file RoleSessions.json.

Type: System.String

Set for profiles intended to be used in regions where a region-specific STS endpoint must be used (eg cn-north-1). If left empty/null, the global endpoint will be used when credentials are obtained for this profile.

Return Value
Type: String
The unique id assigned to the profile.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5