Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReqGitHubOAuth

Req plugin for GitHub authentication.

The plugin authenticates requests to GitHub using GitHub OAuth Device Flow. The GitHub OAuth it uses is: https://github.com/apps/reqgithuboauth.

Usage

Mix.install([
  {:req, "~> 0.3.0"},
  {:req_github_oauth, "~> 0.1.0"}
])

req = Req.new(http_errors: :raise) |> ReqGitHubOAuth.attach()
Req.get!(req, url: "https://api.github.com/user").body["login"]
# Outputs:
# paste this user code:
#
#   6C44-30A8
#
# at:
#
#   https://github.com/login/device
#
# open browser window? [Yn]
# 15:22:28.350 [info] response: authorization_pending
# 15:22:33.519 [info] response: authorization_pending
# 15:22:38.678 [info] response: success
#=> "wojtekmach"

Req.get!(req, url: "https://api.github.com/user").body["login"]
#=> "wojtekmach"

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages