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.

Retrieves the active credential session, if any, associated with the role profile.

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

Syntax

C#
public SAMLImmutableCredentials GetCurrentSession()

Return Value


The current credentials valid for the role specified in the profile. Returns null if no active session is available, or the active session has expired.

Remarks

When a user successfully authenticates and receives temporary AWS credentials for a role, the profile is updated with details of the session. When the profile is loaded by other processes or tools, if session data is present and still valid it can be retrieved using this method avoiding the need to re-authenticate and get additional temporary credentials.

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