SAMLImmutableCredentials ICoreAmazonSTS.CredentialsFromSAMLAuthentication(string endpoint,
string authenticationType,
string roleARN,
TimeSpan credentialDuration,
ICredentials userCredential)
{
SAMLAssertion assertion;
try
{
var authController = new SAMLAuthenticationController(Config.GetWebProxy());
assertion = authController.GetSAMLAssertion(endpoint, userCredential, authenticationType);
}
catch (Exception e)
{
throw new FederatedAuthenticationFailureException("Authentication failure, unable to obtain SAML assertion.", e);
}
try
{
return assertion.GetRoleCredentials(this, roleARN, credentialDuration);
}
catch (Exception e)
{
throw new AmazonClientException("Credential generation failed following successful authentication.", e);
}
}
#endif