Strategy token.
Check whether authentication credentials are present.
Select authentication parameters.
Sends authorization request to GitHub.
Check whether basic authentication credentials are present.
Setup OAuth2 instance.
Makes request to token endpoint and retrieves access token value.
Strategy token
21222324 | # File 'lib/github_api/authorization.rb', line 21defauth_code_verify_clientclient.auth_codeend |
Check whether authentication credentials are present
Returns:
495051 | # File 'lib/github_api/authorization.rb', line 49defauthenticated?basic_authed?||oauth_token?end |
Select authentication parameters
61626364656667 | # File 'lib/github_api/authorization.rb', line 61defauthenticationifbasic_authed?{login:login,password:password}else{}endend |
Sends authorization request to GitHub.
:redirect_uri - Optional string.
:scope - Optional string. Comma separated list of scopes. Available scopes:
(no scope) - public read-only access (includes public user profile info, public repo info, and gists).
user - DB read/write access to profile info only.
public_repo - DB read/write access, and Git read access to public repos.
repo - DB read/write access, and Git read access to public and private repos.
gist - write access to gists.
37383940 | # File 'lib/github_api/authorization.rb', line 37def(params={})_verify_clientclient.auth_code.(params)end |
Check whether basic authentication credentials are present
Returns:
545556 | # File 'lib/github_api/authorization.rb', line 54defbasic_authed?basic_auth?||(login?&&password?)end |
Setup OAuth2 instance
9101112131415161718 | # File 'lib/github_api/authorization.rb', line 9defclient@client||=::OAuth2::Client.new(client_id,client_secret,{:site=>.fetch(:site){Github.site},:authorize_url=>'login/oauth/authorize',:token_url=>'login/oauth/access_token',:ssl=>{:verify=>false}})end |
Makes request to token endpoint and retrieves access token value
43444546 | # File 'lib/github_api/authorization.rb', line 43defget_token(,params={})_verify_clientclient.auth_code.get_token(,params)end |