greatisgreat
Validate cookie in guardian
Is there a way to validate the cookie instead of validating authorization header in guardian?
thanks
Marked As Solved
derek-zhou
According to:
https://github.com/ueberauth/guardian/blob/4512030c4e9d5967a600258d2c2e40328911104c/lib/guardian/plug.ex#L312
and
https://github.com/ueberauth/guardian/blob/4512030c4e9d5967a600258d2c2e40328911104c/lib/guardian/plug/keys.ex#L26
If you want to mimic what Guardian is doing, you need put your token at the cookie key: guardian_default_token
Last Post!
calypso
Hi, I have the exact same issue. I also put the cookie with
Plug.Conn.put_resp_cookie(“guardian_default_token”,token,http_only: true)
But I cannot validate the cookie with this Auth pipeline
defmodule Api.Guardian.AuthPipeline do
use Guardian.Plug.Pipeline, otp_app: :Api,
module: Api.Guardian,
error_handler: Api.AuthErrorHandler
plug :fetch_session
plug Guardian.Plug.VerifySession, key: “guardian_default_token”
plug Guardian.Plug.VerifyCookie
plug Guardian.Plug.EnsureAuthenticated
plug Guardian.Plug.LoadResource
end
Could you possibly provide me some information about the auth pipeline you used?
Thanks
Popular in Discussions
Other popular topics
Latest Phoenix Threads
Chat & Discussions>Discussions
Latest on Elixir Forum
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
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









