Class: OmniAuth::Strategies::Nextcloud

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/nextcloud.rb

Instance Method Summary collapse

Instance Method Details

#clientObject



27
28
29
# File 'lib/omniauth/strategies/nextcloud.rb', line 27

def client
  ::OAuth2::Client.new(options.client_id, options.client_secret, deep_symbolize(merged_client_options))
end

#merged_client_optionsObject



18
19
20
21
22
23
24
25
# File 'lib/omniauth/strategies/nextcloud.rb', line 18

def merged_client_options
  overrides = options.client_options
  {
    site: overrides.site || "#{options.site_url}/index.php/apps/oauth2",
    authorize_url: overrides.authorize_url || "#{options.site_url}/index.php/apps/oauth2/authorize",
    token_url: overrides.token_url || "#{options.site_url}/index.php/apps/oauth2/api/v1/token"
  }
end

#raw_infoObject



55
56
57
# File 'lib/omniauth/strategies/nextcloud.rb', line 55

def raw_info
  @raw_info ||= Hash.from_xml(access_token.get("#{options.site_url}/ocs/v2.php/cloud/user").body)
end