func (c *samlRoleClient) Credentials() (*credentials.Credentials, error) {
	return c.CredentialsWithContext(context.Background())
}
Credentials is the implementation of the CredentialClient interface, and calls CredentialsWithContext with a
background context.
package client
import (
	"context"
	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/mmmorris1975/aws-runas/client/external"
	"github.com/mmmorris1975/aws-runas/credentials"
	"github.com/mmmorris1975/aws-runas/identity"
	"time"
)
type samlRoleClient struct {
	samlClient   external.SamlClient
	roleProvider credentials.SamlRoleProvider
	awsCredCache *aws.CredentialsCache
	session      aws.Config
}
type SamlRoleClientConfig struct {
	external.AuthenticationClientConfig
	Cache    credentials.CredentialCacher
	Duration time.Duration
	RoleArn  string
}
func NewSamlRoleClient(cfg aws.Config, url string, clientCfg *SamlRoleClientConfig) *samlRoleClient {
	p := credentials.NewSamlRoleProvider(cfg, clientCfg.RoleArn, new(credentials.SamlAssertion))
	p.Duration = clientCfg.Duration
	p.Cache = clientCfg.Cache
	p.Logger = clientCfg.Logger
	cfg.Credentials = p
	return &samlRoleClient{
		samlClient:   external.MustGetSamlClient(clientCfg.IdentityProviderName, url, clientCfg.AuthenticationClientConfig),
		roleProvider: p,
		session:      cfg,
		awsCredCache: aws.NewCredentialsCache(p, func(o *aws.CredentialsCacheOptions) {
			o.ExpiryWindow = p.ExpiryWindow
		}),
	}
}
func (c *samlRoleClient) Identity() (*identity.Identity, error) {
	return c.samlClient.Identity()
}
func (c *samlRoleClient) Roles() (*identity.Roles, error) {
	roles, err := c.samlClient.Roles()
	if err != nil {
		var saml *credentials.SamlAssertion
		saml, err = c.samlClient.SamlAssertion()
		if err != nil {
			return nil, err
		}
		c.roleProvider.SamlAssertion(saml)
		roles, err = c.samlClient.Roles()
	}
	return roles, err
}