{"repo":"ueberauth/oauth2","free":true,"listed":false,"github":"https://github.com/ueberauth/oauth2","clone":"git clone https://github.com/ueberauth/oauth2.git","description":"An Elixir OAuth 2.0 Client Library","language":"Elixir","stars":771,"topics":["elixir","oauth2","http"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"OAuth2 (Client) An Elixir OAuth 2.0 Client Library. Install Configure a serializer This library can be configured to handle encoding and decoding requests and responses automatically based on the accept and/or content-type headers. If you need to handle various MIME types, you can simply register serializers like so: The modules are expected to export encode!/1 and decode!/1 . Please see the documentation for OAuth2.Serializer for more details. Configure a http client The http client library used is tesla, the default adapter is Httpc, since it comes out of the box with every Erlang instance but you can easily change it to something better. You can configure another adaptor like this: You can also add your own tesla middleware: Debug mode Sometimes it's handy to see what's coming back from the response when getting a token. You can configure OAuth2 to output the response like so: Usage Current implemented strategies: - Authorization Code - Password - Client Credentials Authorization Code Flow (AuthCode Strategy) Client Credentials Flow Getting an initial access token: Refreshing an access token: Write Your Own Strategy Here's an example strategy for GitHub: Here's how you'd use the example GitHub strategy: Generate the authorize URL and redirect the client for authorization. Capture the code in your callback route on your server and use it to obtain an access token. Use the access token to access desired resources. Examples - Authenticate with Github (OAuth2/Phoenix) License ","default_branch":null,"files":null,"tree":[],"storefront":"/r/ueberauth","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ueberauth/oauth2/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}