danschultzer

danschultzer

Pow Core Team

OAuth 2.0 provider for Elixir and Phoenix

In short
Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependency and run the install task. That’s it! :rocket:

ExOauth2Provider
PhoenixOauth2Provider

Background
This is my first full project in Elixir. The reason for building these hex libraries was that I needed a flexible plug n’ play OAuth 2.0 provider for a Phoenix project I’m working on. The other options I found didn’t cut it for me, and I was looking for something akin to Doorkeeper for Rails. Basically a no brainer library, that I can adjust after getting it up and running.

Use case
I wrote a blog post on how you can create a versioned API using OAuth 2.0 access tokens in minutes using this library: https://dreamconception.com/tech/phoenix-full-fledged-api-in-five-minutes/

I hope this can be useful for some of you. Please feel free to help improve the libraries with suggestions or PR’s!

Most Liked

danschultzer

danschultzer

Pow Core Team

I’ve made a few updates since I wrote this post. Now there’s added support for UUID (or custom primary key type), and works with Phoenix 1.3. Blog post has been updated too. All feedback is welcome :rocket:

danschultzer

danschultzer

Pow Core Team

Finally got around to rewriting these libraries. With Pow I got a much better idea how these libraries should work.

It will be much easier to contribute to them moving forward :rocket: It was a major rewrite so there are probably a lot of things that can be refactored, and I have overlooked. Any help would be much appreciated!

ExOauth2Provider v0.5.0 changes

Changelog

  • Schema modules are now generated (with mix ex_oauth2_provider.gen.schemas). Now all configuration (e.g. binary id) are done on the individual schema modules. Previously there were issues if e.g. some app environment was not available during compilation, and configuration wasn’t particularly explicit.
  • Configuration are primarily passed through the method calls with fallback to app environment.
  • Ecto 3.0 support.

PhoenixOauth2Provider 0.5.0

Changelog

  • Templates are now built in so you can get started without generating any views/templates!
  • Phoenix 1.4 support.
cmush

cmush

Thanks @danschultzer for the awesome work on the Oauth2.0 Provider. It’s been very helpful.

I was just wondering if an update for phoenix_oauth2_provider is on the way since the library currently depends on {:ex_oauth2_provider, "~> 0.5.1"} while the latest version of that library is {:ex_oauth2_provider, "~> 0.5.6"} which I imagine brings a bunch of improvements.

Where Next?

Popular in Libraries Top

kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
mathieuprog
Hello :wave: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First and fore...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps...
New
archan937
It is a well-know topic within the Elixir community: “To mock or not to mock? :)” Every alchemist probably has his / her own opinion con...
New
benlime
I created a new library GitHub - benvp/ex_cva: Class Variance Authority for Elixir which aims to make it very easy to define different va...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: https://github.com/tmbb/phoenix_ws Phoenix channels are a great...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
gjaldon
As the title states, EctoEnum has just been updated after some time of hardly any activity in the repo. Here’s the latest release: https:...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

Sub Categories:

We're in Beta

About us Mission Statement