class Sitefull::Auth::Azure

Constants

AUTHORIZATION_URI
CALLBACK_URI
MISSING_TENANT_ID
SCOPE
TOKEN_CREDENTIALS_URI

Public Instance Methods

authorization_uri(options) click to toggle source
# File lib/sitefull-cloud/auth/azure.rb, line 36
def authorization_uri(options)
  sprintf(AUTHORIZATION_URI, options[:tenant_id])
end
authorization_url_options() click to toggle source
Calls superclass method
# File lib/sitefull-cloud/auth/azure.rb, line 23
def authorization_url_options
  super.merge({ resource: 'https://management.core.windows.net/'})
end
callback_uri() click to toggle source
# File lib/sitefull-cloud/auth/azure.rb, line 32
def callback_uri
  CALLBACK_URI
end
credentials(token) click to toggle source
# File lib/sitefull-cloud/auth/azure.rb, line 27
def credentials(token)
  token_provider = MsRest::StringTokenProvider.new(token.access_token)
  MsRest::TokenCredentials.new(token_provider)
end
required_settings() click to toggle source
Calls superclass method
# File lib/sitefull-cloud/auth/azure.rb, line 48
def required_settings
  super << :tenant_id
end
scope() click to toggle source
# File lib/sitefull-cloud/auth/azure.rb, line 40
def scope
  SCOPE
end
token_credentials_uri(options) click to toggle source
# File lib/sitefull-cloud/auth/azure.rb, line 44
def token_credentials_uri(options)
  sprintf(TOKEN_CREDENTIALS_URI, options[:tenant_id])
end
validate(options = {}) click to toggle source
Calls superclass method
# File lib/sitefull-cloud/auth/azure.rb, line 18
def validate(options = {})
  fail MISSING_TENANT_ID if options[:tenant_id].nil? || options[:tenant_id].to_s.empty?
  super(options)
end