Method: Azure::ServiceBus::Auth::WrapService#get_access_token

Defined in:
lib/azure/service_bus/auth/wrap_service.rb

#get_access_token(resource_uri) ⇒ Object

Gets a WRAP access token with specified parameters.

Returns access token (String)



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/azure/service_bus/auth/wrap_service.rb', line 32

def get_access_token(resource_uri)
    uri = wrap_uri

    body = get_wrap_acs_body(resource_uri)

    headers = {
      "Content-Type" => "application/x-www-form-urlencoded",
      "Content-Length" => "0"
    }

    response = call(:post, uri, body, headers)
    parse_token(response.body)
end