class Aws::SSOCredentials

def initialize(options = {})

Options Hash: (**options)
  • before_refresh (Callable) -- Proc called before
  • :client (SSO::Client) -- Optional `SSO::Client`. If not
  • :sso_start_url (required, String) -- The start URL is
  • :sso_role_name (required, String) -- The corresponding
  • :sso_region (required, String) -- The AWS region where the
  • :sso_account_id (required, String) -- The AWS account ID
def initialize(options = {})
  missing_keys = SSO_REQUIRED_OPTS.select { |k| options[k].nil? }
  unless missing_keys.empty?
    raise ArgumentError, "Missing required keys: #{missing_keys}"
  end
  @sso_start_url = options.delete(:sso_start_url)
  @sso_region = options.delete(:sso_region)
  @sso_role_name = options.delete(:sso_role_name)
  @sso_account_id = options.delete(:sso_account_id)
  # validate we can read the token file
  read_cached_token
  client_opts = {}
  options.each_pair { |k,v| client_opts[k] = v unless CLIENT_EXCLUDE_OPTIONS.include?(k) }
  client_opts[:region] = @sso_region
  client_opts[:credentials] = nil
  @client = options[:client] || Aws::SSO::Client.new(client_opts)
  @async_refresh = true
  super
end