riverrun

riverrun OP

Openmaize is an authentication library which relies heavily on Plug and uses JSON Web Tokens for authentication.
I’ve just released version 1.0.0-beta. For people who are already using Openmaize, change the :openmaize line in the deps in your mix.exs file to {:openmaize, “~> 1.0.0-beta”} and read the following guide about the other changes that need to be made. The major change since the last version is that the database functions have been moved outside of the Openmaize library, and you need to generate these functions by running the mix openmaize.gen.ectodb command (if you are using Ecto).
If you have any questions / comments, please let me know.

First 10 of 13 Posts Switch mode

egor

egor

Hi @riverrun, thanks for the great library!

Do you have any plans to add oAuth providers support (e.g. Facebook)?

riverrun

riverrun OP

Yes, but I don’t know when. I need to do a little bit of research about them first and then look into implementing them.

OvermindDL1

OvermindDL1

I current use Ueberauth at work for authentication (using a ueberauth_ldap plugin to access the LDAP server) as well as the Google OAuth to authenticate to our Google Business account as well. How would openmaize work in comparison?

riverrun

riverrun OP

To tell you the truth, I’m not really sure how they are different. I’ll have a closer look at Ueberauth and try to find out more.
Regarding Oauth, though, Openmaize doesn’t support it at the moment. It uses password authentication, with support for two-factor authentication, and if password authentication succeeds, then a JSON Web Token is used to authenticate subsequent requests.

riverrun

riverrun OP

A quick update and notification about a change in beta.2:

Before, there was a database setting called db_module in the config. That has now been removed, and you have to set the db_module directly when you use the plugs. There’s an example in this module. The plugs affected are Openmaize.Login, Openmaize.OnetimePass, Openmaize.ConfirmEmail and OpenmaizeResetPassword.

If any of this is unclear or you have any questions, please let me know.

riverrun

riverrun OP

I’ve release version 1.0 (no beta).
Other news is that I’ve opened an issue about adding an option to use sessions instead of JWTs. It would be good to get some feedback about what developers would prefer.
There is also this issue about migrating from Rails / devise. I hope to be making some improvements to the documentation about this in the next few days.

riverrun

riverrun OP

I’ve just released openmaize version 2.0, which uses Plug cookie-based sessions by default, and openmaize_jwt version 1.0, which uses JSON Web Tokens.
Here is the upgrade guide for openmaize, and
here is the upgrade guide for openmaize_jwt.
Here is an example app using openmaize, and here is
an example app using openmaize_jwt.

riverrun

riverrun OP

Small update to using the Plugs in Openmaize:
If you are using the db_module generated by openmaize.gen.ectodb, you don’t need to write db_module: MyApp.OpenmaizeEcto any more, as this is now the default value.
So, for example, plug Openmaize.Login, [db_module: MyApp.OpenmaizeEcto] when action in [:login_user] can now be written as plug Openmaize.Login when action in [:login_user].
If you have any questions, just let me know.

riverrun

riverrun OP

Just released version 2.2 of Openmaize.

There are two big changes:

  1. The generator mix openmaize.gen.phoenixauth is a lot more powerful now and running it after mix phoenix.new will produce a workable app with user authentication. If you add the --confirm option, it will also produce the modules needed for email confirmation and password resetting. See this guide for more info. I’m afraid there isn’t much support for generating files for apis - I haven’t had enough time.
  2. I’ve moved the database-related functions to within Openmaize (they were previously separate to allow developers to use custom database modules, but I now think that this is not necessary, and making this change makes the library more maintainable). If you’re upgrading from a previous version, please read this guide.
riverrun

riverrun OP

Last week I updated Openmaize to version 3.0.

The major changes are that I’ve added configurable logging to it and updated the installer (for Phoenix apps) and the wiki.

For anyone who is already using Openmaize, there are two other small changes:

  • the default unique_id (user-identifier) for the Login and OnetimePass modules is now email (instead of username).
  • the user map that is returned by the Openmaize Plugs now filters out certain keys to help prevent sensitive information being leaked

At the moment, the logging provides info and warn messages in logfmt format. The log level, though, can be changed by setting the log_level value in the config - and it can be turned off by setting this value to false.

Finally, many thanks to everyone who has contributed to this project, especially Christian Bäuerlein and Franco Bellagamba, who helped with the installer, Ben Sharman, who contributed to the logging feature, and Guido Tripaldi, who worked with me on making the OnetimePass Plug more secure.

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement