bobbypriambodo
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! ![]()
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto.
pagination
cursor pagination
sorta...
New
Other Trending Topics
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
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
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
Awesome! Just need a VerifyCookie to copy the VerifyHeader functionality and it is the basics of what is needed.
OvermindDL1
And a way to customize the assign key to something other than
:useras someone may already use:useror may want multiple lookups.EDIT: And a way to customize the callback function name too on EnsureAuthenticated. ^.^
chrismccord
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 thePhoenixToken.Plugmodule could be called as normal.bobbypriambodo
@OvermindDL1, thanks for the suggestions! I’ll see what I can do
Oh, I must have missed the convention. My reference for naming it was this point on https://hex.pm/docs/publish:
Since I thought
Phoenix.Token.Pluggives the verifying functionality toPhoenix.Token, that was what I went with. I probably misunderstood that point. I’ll rename it ASAP, thanks for the recommendation!bobbypriambodo
I’ve just published
phoenix_token_plugv0.2.0, which renames the namespace toPhoenixTokenPlug. I figured I might as well merge the.Plugnamespace sincePhoenixTokenwouldn’t have any functionality on its own (and neither wouldPhoenixToken.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
OvermindDL1
Eeh, you never know, could end up writing more non-plug helpers for it or so. ^.^
/me is a fan of more namespaces.
bobbypriambodo
At least I still have the
I guess we’ll see how it unfolds, naming things is hard.
PhoenixTokenPlugmodule for utility functions, or if it comes to it, possiblyPhoenixTokenPlug.Utils?bobbypriambodo
I have an idea in mind, but I want to make sure first: how do you see this happening? Is it common to put stateless authentication tokens in their cookies, seeing as
Plug.Sessionalready has a solution for putting session data in and storing the key in cookies? And do you think that means we needVerifySessiontoo (seeing as Guardian has one)? It would probably help if you provide some example use cases for itOvermindDL1
A
VerifySessionwould probably make more sense yep.