Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token Customization #55

Open
sgeos opened this issue Oct 4, 2017 · 1 comment
Open

Token Customization #55

sgeos opened this issue Oct 4, 2017 · 1 comment

Comments

@sgeos
Copy link

sgeos commented Oct 4, 2017

Guardian.Plug.sign_in(user) calls appear in a number of places in few files. As of now, there does not appear to be a way to add permissions or otherwise customize generated tokens.

Maybe a solution would be factoring these calls out into something like a TokenMint module?

defmodule TokenMint do
  def sign_in(conn, user), do: Guardian.Plug.sign_in(conn, user)
end

A configuration option could be used to replace this with a user supplied module/function/plug that takes the user and uses it to mint a customized token. Would this be a reasonable way of issuing customized tokens in Sentinel?

@britton-jb
Copy link
Owner

@sgeos have you looked at Guardian 1.0? I believe you're talking about token customization as described there? I'm interested in including that kind of functionality, I just want to make sure I understand it fully enough to do a compatible implementation well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants