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


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.


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 Standard:
Supported in: 1.3

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