A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://rubydoc.info/github/piotrmurach/github/master/Github/Authorization below:

Authorization – Documentation for piotrmurach/github (master) – RubyDoc.info

Module: Github::Authorization
Included in:
API
Defined in:
lib/github_api/authorization.rb
Instance Method Summary collapse Instance Method Details #auth_code ⇒ Object
21
22
23
24
# File 'lib/github_api/authorization.rb', line 21

def auth_code
  _verify_client
  client.auth_code
end
#authenticated? ⇒ Boolean

Check whether authentication credentials are present

49
50
51
# File 'lib/github_api/authorization.rb', line 49

def authenticated?
  basic_authed? || oauth_token?
end
#authentication ⇒ Object

Select authentication parameters

61
62
63
64
65
66
67
# File 'lib/github_api/authorization.rb', line 61

def authentication
  if basic_authed?
    { login: login, password: password }
  else
    {}
  end
end

Sends authorization request to GitHub.

Parameters
37
38
39
40
# File 'lib/github_api/authorization.rb', line 37

def authorize_url(params = {})
  _verify_client
  client.auth_code.authorize_url(params)
end
#basic_authed? ⇒ Boolean

Check whether basic authentication credentials are present

54
55
56
# File 'lib/github_api/authorization.rb', line 54

def basic_authed?
  basic_auth? || (login? && password?)
end
#client ⇒ Object
9
10
11
12
13
14
15
16
17
18
# File 'lib/github_api/authorization.rb', line 9

def client
  @client ||= ::OAuth2::Client.new(client_id, client_secret,
    {
      :site          => current_options.fetch(:site) { Github.site },
      :authorize_url => 'login/oauth/authorize',
      :token_url     => 'login/oauth/access_token',
      :ssl           => { :verify => false }
    }
  )
end
#get_token(authorization_code, params = {}) ⇒ Object

Makes request to token endpoint and retrieves access token value

43
44
45
46
# File 'lib/github_api/authorization.rb', line 43

def get_token(authorization_code, params = {})
  _verify_client
  client.auth_code.get_token(authorization_code, params)
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4