bobbypriambodo

bobbypriambodo

PhoenixTokenPlug, for authentication with Phoenix.Token

Hi, I’ve just released my first hex package today (yay!).

Phoenix.Token.Plug is a collection of plugs for Phoenix.Token-based authentication, useful for API calls. It’s a bit like Guardian, but designed to use Phoenix.Token instead of JWT. Currently it only supports verifying Authorization header and ensuring that a request is authenticated, which fits my use case, but there are more available and interesting capabilities yet to be discovered.

Usage instruction is on the GitHub readme. Do give feedbacks, issues, and PRs! :smile:

Most Liked

chrismccord

chrismccord

Creator of Phoenix

Very nice! One recommendation I have is the community convention would be to not stomp the Phoenix namespace. So instead of Phoenix.Token.Plug, can you rename your project to PhoenixToken? Then the PhoenixToken.Plug module could be called as normal.

OvermindDL1

OvermindDL1

Awesome! Just need a VerifyCookie to copy the VerifyHeader functionality and it is the basics of what is needed. :slight_smile:

bobbypriambodo

bobbypriambodo

I’ve just published phoenix_token_plug v0.2.0, which renames the namespace to PhoenixTokenPlug. I figured I might as well merge the .Plug namespace since PhoenixToken wouldn’t have any functionality on its own (and neither would PhoenixToken.Plug). I’ve also added the functionality suggestions to the repo’s issues and will tackle it when I have the time.

Keep in mind that the API might still be unstable at this point :slight_smile:

bobbypriambodo

bobbypriambodo

At least I still have the PhoenixTokenPlug module for utility functions, or if it comes to it, possibly PhoenixTokenPlug.Utils? :wink: I guess we’ll see how it unfolds, naming things is hard.

OvermindDL1

OvermindDL1

And a way to customize the assign key to something other than :user as someone may already use :user or may want multiple lookups. :slight_smile:

EDIT: And a way to customize the callback function name too on EnsureAuthenticated. ^.^

Where Next?

Popular in Libraries Top

scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement