All Projects → lexmag → oauther

lexmag / oauther

Licence: ISC license
OAuth 1.0 for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to oauther

Weibo
[READ ONLY] Subtree split of the SocialiteProviders/Weibo Provider (see SocialiteProviders/Providers)
Stars: ✭ 37 (-42.19%)
Mutual labels:  oauth, oauth1
Slack
[READ ONLY] Subtree split of the SocialiteProviders/Slack Provider (see SocialiteProviders/Providers)
Stars: ✭ 11 (-82.81%)
Mutual labels:  oauth, oauth1
Instagram
[READ ONLY] Subtree split of the SocialiteProviders/Instagram Provider (see SocialiteProviders/Providers)
Stars: ✭ 34 (-46.87%)
Mutual labels:  oauth, oauth1
Twitter
[READ ONLY] Subtree split of the SocialiteProviders/Twitter Provider (see SocialiteProviders/Providers)
Stars: ✭ 21 (-67.19%)
Mutual labels:  oauth, oauth1
electron-oauth-helper
Easy to use helper library for OAuth1 and OAuth2.
Stars: ✭ 55 (-14.06%)
Mutual labels:  oauth, oauth1
Twitch
[READ ONLY] Subtree split of the SocialiteProviders/Twitch Provider (see SocialiteProviders/Providers)
Stars: ✭ 20 (-68.75%)
Mutual labels:  oauth, oauth1
erlang-oauth
An Erlang OAuth 1.0 implementation
Stars: ✭ 298 (+365.63%)
Mutual labels:  oauth, oauth1
Oauthswift
Swift based OAuth library for iOS
Stars: ✭ 2,949 (+4507.81%)
Mutual labels:  oauth, oauth1
Spotify
[READ ONLY] Subtree split of the SocialiteProviders/Spotify Provider (see SocialiteProviders/Providers)
Stars: ✭ 13 (-79.69%)
Mutual labels:  oauth, oauth1
VKontakte
[READ ONLY] Subtree split of the SocialiteProviders/VKontakte Provider (see SocialiteProviders/Providers)
Stars: ✭ 82 (+28.13%)
Mutual labels:  oauth, oauth1
oauth-provider-sample
A Spring Security OAuth provider, developed in my monograph about SSO and OAuth
Stars: ✭ 13 (-79.69%)
Mutual labels:  oauth, oauth1
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+3529.69%)
Mutual labels:  oauth, oauth1
Spring Security Pac4j
pac4j security library for Spring Security: OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 231 (+260.94%)
Mutual labels:  oauth
react-linkedin-login-oauth2
Easily get Authorization Code from Linked In to log in without redirecting.
Stars: ✭ 83 (+29.69%)
Mutual labels:  oauth
Angularmaterialfirebase
🔥 Full stack starter app with Angular 8, Material Design and Firebase (+ demo)
Stars: ✭ 229 (+257.81%)
Mutual labels:  oauth
Identityserver
An open-source, standards-compliant, and flexible OpenID Connect and OAuth 2.x framework for ASP.NET Core
Stars: ✭ 223 (+248.44%)
Mutual labels:  oauth
ApiJwtWithTwoSts
Web API authorization, multi-IDP solutions in ASP.NET Core
Stars: ✭ 43 (-32.81%)
Mutual labels:  oauth
Apijam
GitHub repo for API Jam Workshop
Stars: ✭ 254 (+296.88%)
Mutual labels:  oauth
Praw
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Stars: ✭ 2,675 (+4079.69%)
Mutual labels:  oauth
Reddift
Swift Reddit API Wrapper
Stars: ✭ 215 (+235.94%)
Mutual labels:  oauth

OAuther

CI Status Hex Version

OAuther is a library to authenticate using the OAuth 1.0 protocol.

All the standard signature methods are supported:

  • HMAC-SHA1
  • RSA-SHA1
  • PLAINTEXT

This library also supports non-standard signature methods (that replace SHA-1 with stronger hashing algorithms):

  • HMAC-SHA256

Installation

Add the :oauther dependency to your mix.exs file:

defp deps do
  [{:oauther, "~> 1.1"}]
end

Then, run mix deps.get in your shell to fetch the dependencies.

Usage

The example below shows the use of hackney HTTP client for interacting with the Twitter API. Protocol parameters are transmitted using the HTTP "Authorization" header.

creds = OAuther.credentials(consumer_key: "dpf43f3p2l4k3l03", consumer_secret: "kd94hf93k423kf44", token: "nnch734d00sl2jdk", token_secret: "pfkkdhi9sl3r4s00")
#=> %OAuther.Credentials{
#=>   consumer_key: "dpf43f3p2l4k3l03",
#=>   consumer_secret: "kd94hf93k423kf44",
#=>   method: :hmac_sha1,
#=>   token: "nnch734d00sl2jdk",
#=>   token_secret: "pfkkdhi9sl3r4s00"
#=> }

params = OAuther.sign("post", "https://api.twitter.com/1.1/statuses/lookup.json", [{"id", 485086311205048320}], creds)
#=> [
#=>   {"oauth_signature", "ariK9GrGLzeEJDwQcmOTlf7jxeo="},
#=>   {"oauth_consumer_key", "dpf43f3p2l4k3l03"},
#=>   {"oauth_nonce", "L6a3Y1NeNwbU9Sqd6XnwNU+pjm6o0EyA"},
#=>   {"oauth_signature_method", "HMAC-SHA1"},
#=>   {"oauth_timestamp", 1517250224},
#=>   {"oauth_version", "1.0"},
#=>   {"oauth_token", "nnch734d00sl2jdk"},
#=>   {"id", 485086311205048320}
#=> ]

{header, req_params} = OAuther.header(params)
#=> {{"Authorization",
#=>   "OAuth oauth_signature=\"ariK9GrGLzeEJDwQcmOTlf7jxeo%3D\", oauth_consumer_key=\"dpf43f3p2l4k3l03\", oauth_nonce=\"L6a3Y1NeNwbU9Sqd6XnwNU%2Bpjm6o0EyA\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1517250224\", oauth_version=\"1.0\", oauth_token=\"nnch734d00sl2jdk\""},
#=>  [{"id", 485086311205048320}]}

:hackney.post("https://api.twitter.com/1.1/statuses/lookup.json", [header], {:form, req_params})
#=> {:ok, 200, [...], #Reference<0.0.0.837>}

License

OAuther is released under the ISC license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].