Class: MsRest::StringTokenProvider

Inherits:
TokenProvider show all
Defined in:
lib/ms_rest/credentials/string_token_provider.rb

Overview

Class that provides access to authentication token.

Instance Method Summary collapse

Constructor Details

#initialize(token, token_type = TokenCredentials::DEFAULT_SCHEME) ⇒ StringTokenProvider

Returns a new instance of StringTokenProvider.

Parameters:

  • token (String)

    the access token.

  • token_type (String) (defaults to: TokenCredentials::DEFAULT_SCHEME)

    the token type.



27
28
29
30
# File 'lib/ms_rest/credentials/string_token_provider.rb', line 27

def initialize(token, token_type = TokenCredentials::DEFAULT_SCHEME)
  @token = token
  @token_type = token_type
end

Instance Method Details

#get_authentication_headerString

Returns the string value which needs to be attached to HTTP request header in order to be authorized.

Returns:

  • (String)

    authentication headers.



37
38
39
# File 'lib/ms_rest/credentials/string_token_provider.rb', line 37

def get_authentication_header
  "#{token_type} #{token}"
end