# \#guardian

**URL:** https://forum.elixirforum.com/tag/guardian/721.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Guardian Integration in umbrella project using erlang 28.0 elixir 1.18.4-otp-28](https://forum.elixirforum.com/t/guardian-integration-in-umbrella-project-using-erlang-28-0-elixir-1-18-4-otp-28/71900)

<div class="topic-metadata">

**Author:** [@fasihunnabi](https://forum.elixirforum.com/u/fasihunnabi)\
**Replies:** 2\
**Last updated:** [August 21, 2025, 9:04am UTC](https://forum.elixirforum.com/t/guardian-integration-in-umbrella-project-using-erlang-28-0-elixir-1-18-4-otp-28/71900 "2025-08-21T09:04:02Z")

</div>

I am using erlang 28.0 elixir 1.18.4-otp-28 in my umbrella project and its giving me reference error given below. has anyone faced anything like this with latest versions? when i remove guarding configuration this goes…

---

## [Phoenix Elixir Guardian Error - (MatchError) no match of right hand side value: {:error, :secret\_not\_found}](https://forum.elixirforum.com/t/phoenix-elixir-guardian-error-matcherror-no-match-of-right-hand-side-value-error-secret-not-found/67657)

<div class="topic-metadata">

**Author:** [@RaghulR87](https://forum.elixirforum.com/u/RaghulR87)\
**Replies:** 2\
**Last updated:** [November 23, 2024, 2:59pm UTC](https://forum.elixirforum.com/t/phoenix-elixir-guardian-error-matcherror-no-match-of-right-hand-side-value-error-secret-not-found/67657 "2024-11-23T14:59:00Z")

</div>

New to Elixir Phoenix framework, enjoying the framework till now. Am trying to setup auth module with guardian deps for generating access and refresh token, however I receive below error message when I call the controll…

---

## [Using both a password based and OpenId based authentication using Guardian](https://forum.elixirforum.com/t/using-both-a-password-based-and-openid-based-authentication-using-guardian/67225)

<div class="topic-metadata">

**Author:** [@Rya](https://forum.elixirforum.com/u/Rya)\
**Replies:** 3\
**Last updated:** [November 5, 2024, 11:45pm UTC](https://forum.elixirforum.com/t/using-both-a-password-based-and-openid-based-authentication-using-guardian/67225 "2024-11-05T23:45:35Z")

</div>

Issue: I’m currently trying to implement support for openID authentication using guardian for a RESTful api. The api i’m currently working with supports authentication with a password stored as a hash on the api’s db. I…

---

## [How to implement Apple Login in a Phoenix app?](https://forum.elixirforum.com/t/how-to-implement-apple-login-in-a-phoenix-app/36849)

<div class="topic-metadata">

**Author:** [@pedrocaseiro](https://forum.elixirforum.com/u/pedrocaseiro)\
**Replies:** 9\
**Last updated:** [November 2, 2024, 8:32pm UTC](https://forum.elixirforum.com/t/how-to-implement-apple-login-in-a-phoenix-app/36849 "2024-11-02T20:32:01Z")

</div>

Hey everyone! I’m currently implementing sign in with apple on my app. I’m already at the point where I got the JWT that I need to decode to validate the user and the key hash from apple (includes the kid, the alg etc… …

---

## [WebSocket JWT Socket Authentication via Guardian and Phoenix](https://forum.elixirforum.com/t/websocket-jwt-socket-authentication-via-guardian-and-phoenix/63086)

<div class="topic-metadata">

**Author:** [@Stickersss](https://forum.elixirforum.com/u/Stickersss)\
**Replies:** 2\
**Last updated:** [April 25, 2024, 4:20pm UTC](https://forum.elixirforum.com/t/websocket-jwt-socket-authentication-via-guardian-and-phoenix/63086 "2024-04-25T16:20:12Z")

</div>

Long story short, I have a JavaScript frontend client and two backends: one in Python (for login/signup) and one in Phoenix (used only for websockets). My Python backend sets an HTTP-only JWT token and successfully hand…

---

## [Guardian Refresh Token In Cookie Pipeline](https://forum.elixirforum.com/t/guardian-refresh-token-in-cookie-pipeline/59588)

<div class="topic-metadata">

**Author:** [@micahsoftdotexe](https://forum.elixirforum.com/u/micahsoftdotexe)\
**Replies:** 11\
**Last updated:** [November 15, 2023, 4:32pm UTC](https://forum.elixirforum.com/t/guardian-refresh-token-in-cookie-pipeline/59588 "2023-11-15T16:32:40Z")

</div>

Greetings, I am attempting to implement a jwt pattern in phoenix using guardian. What I am doing is that I am returning a short lived access token in the response and a long lived refresh token in the cookies. So far, I…

---

## [Guardian generating an expired token because System.system\_time != DateTime. Is this time warp?](https://forum.elixirforum.com/t/guardian-generating-an-expired-token-because-system-system-time-datetime-is-this-time-warp/56110)

<div class="topic-metadata">

**Author:** [@pejrich](https://forum.elixirforum.com/u/pejrich)\
**Replies:** 31\
**Last updated:** [September 15, 2023, 1:31am UTC](https://forum.elixirforum.com/t/guardian-generating-an-expired-token-because-system-system-time-datetime-is-this-time-warp/56110 "2023-09-15T01:31:42Z")

</div>

I’m using Guardian to handle JWT tokens, and I noticed that after a given amount of time, the client app would not be able to refresh an refresh token into an access token. The request to refresh it would succeed, but th…

---

## [API token is invalid\_token when decoding with guardian](https://forum.elixirforum.com/t/api-token-is-invalid-token-when-decoding-with-guardian/54440)

<div class="topic-metadata">

**Author:** [@tmariaz](https://forum.elixirforum.com/u/tmariaz)\
**Replies:** 11\
**Last updated:** [March 24, 2023, 2:48am UTC](https://forum.elixirforum.com/t/api-token-is-invalid-token-when-decoding-with-guardian/54440 "2023-03-24T02:48:38Z")

</div>

My API which authenticates via auth0 and returns the access\_token. During the callback, the access\_token throws invalid\_token error. Not sure what is going on. Here are my codes. router.ex scope "/auth", PxrfWeb do …

---

## [Guardian error when creating jwt token](https://forum.elixirforum.com/t/guardian-error-when-creating-jwt-token/53924)

<div class="topic-metadata">

**Author:** [@zoedsoupe](https://forum.elixirforum.com/u/zoedsoupe)\
**Replies:** 5\
**Last updated:** [February 16, 2023, 8:00pm UTC](https://forum.elixirforum.com/t/guardian-error-when-creating-jwt-token/53924 "2023-02-16T20:00:59Z")

</div>

I have this Guardian module: defmodule Sntx.Guardian do use Guardian, otp\_app: :sntx alias Sntx.Repo alias Sntx.User.Account def subject\_for\_token(user, \_claims) do sub = to\_string(user.id) {:ok, sub} …

---

## [Guardian.Phoenix.Controller is not loaded and could not be found](https://forum.elixirforum.com/t/guardian-phoenix-controller-is-not-loaded-and-could-not-be-found/52113)

<div class="topic-metadata">

**Author:** [@tmariaz](https://forum.elixirforum.com/u/tmariaz)\
**Replies:** 0\
**Last updated:** [November 30, 2022, 8:12am UTC](https://forum.elixirforum.com/t/guardian-phoenix-controller-is-not-loaded-and-could-not-be-found/52113 "2022-11-30T08:12:01Z")

</div>

Hi, I’m new to Elixir and Phoenix. I recently came across to work on a phoenix project (ver 1.3) developed for an API and now the company wanted to update the framework to 1.6.15 and I’ve managed to do necessary changes…

---

## [How do I set permissions for Guardian from a DB table. In my app users can create tables in the database and I need a  way update or provide the base permissions for Guardian at runtime ](https://forum.elixirforum.com/t/how-do-i-set-permissions-for-guardian-from-a-db-table-in-my-app-users-can-create-tables-in-the-database-and-i-need-a-way-update-or-provide-the-base-permissions-for-guardian-at-runtime/50430)

<div class="topic-metadata">

**Author:** [@kairos0ne](https://forum.elixirforum.com/u/kairos0ne)\
**Replies:** 0\
**Last updated:** [September 21, 2022, 6:18pm UTC](https://forum.elixirforum.com/t/how-do-i-set-permissions-for-guardian-from-a-db-table-in-my-app-users-can-create-tables-in-the-database-and-i-need-a-way-update-or-provide-the-base-permissions-for-guardian-at-runtime/50430 "2022-09-21T18:18:32Z")

</div>

Problem Statement I tried to get the permissions structured correctly for Guardian in my Guardian module like so. defmodule Dynamic.Guardian do alias Dynamic.BaseContent alias Dynamic.BaseStructures alias Dynamic…

---

## [Do refresh tokens provide a false sense of security?](https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702)

<div class="topic-metadata">

**Author:** [@Pistrie](https://forum.elixirforum.com/u/Pistrie)\
**Replies:** 48\
**Last updated:** [August 30, 2022, 3:55pm UTC](https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702 "2022-08-30T15:55:15Z")

</div>

I’m following a guide on Guardian authentication with elixir, but the need for refresh tokens isn’t very clear to me. This is my current understanding: Access tokens allow a user to make secure calls to the API Access …

---

## [Guardian JWT is generated with the wrong time](https://forum.elixirforum.com/t/guardian-jwt-is-generated-with-the-wrong-time/46552)

<div class="topic-metadata">

**Author:** [@heitorlisboa](https://forum.elixirforum.com/u/heitorlisboa)\
**Replies:** 2\
**Last updated:** [March 12, 2022, 10:58pm UTC](https://forum.elixirforum.com/t/guardian-jwt-is-generated-with-the-wrong-time/46552 "2022-03-12T22:58:29Z")

</div>

I’m building an authentication API using Phoenix, Guardian and Bcrypt, but I’m having an issue with the time present on the tokens generated by Guardian. At the same time the token was generated, my validation on the fro…

---

## [Validate cookie in guardian](https://forum.elixirforum.com/t/validate-cookie-in-guardian/39730)

<div class="topic-metadata">

**Author:** [@greatisgreat](https://forum.elixirforum.com/u/greatisgreat)\
**Replies:** 12\
**Last updated:** [July 13, 2021, 4:35pm UTC](https://forum.elixirforum.com/t/validate-cookie-in-guardian/39730 "2021-07-13T16:35:52Z")

</div>

Is there a way to validate the cookie instead of validating authorization header in guardian? thanks

---

## [Guardian\_redis - Guardian.DB Redis repo](https://forum.elixirforum.com/t/guardian-redis-guardian-db-redis-repo/39679)

<div class="topic-metadata">

**Author:** [@alexfilatov](https://forum.elixirforum.com/u/alexfilatov)\
**Replies:** 0\
**Last updated:** [May 13, 2021, 9:49pm UTC](https://forum.elixirforum.com/t/guardian-redis-guardian-db-redis-repo/39679 "2021-05-13T21:49:43Z")

</div>

Hello everyone! This is guardian\_redis - a small library for storing JWT tokens (by guardian) in the Redis. The library is built on top of the Guardian.DB, which stores JWT tokens in Postgres, implementing Guardian.DB.…

---

## [Hello there, I need help to signout or revoke token to my API phoenix with Guardian](https://forum.elixirforum.com/t/hello-there-i-need-help-to-signout-or-revoke-token-to-my-api-phoenix-with-guardian/39247)

<div class="topic-metadata">

**Author:** [@bian2510](https://forum.elixirforum.com/u/bian2510)\
**Replies:** 4\
**Last updated:** [April 27, 2021, 6:03pm UTC](https://forum.elixirforum.com/t/hello-there-i-need-help-to-signout-or-revoke-token-to-my-api-phoenix-with-guardian/39247 "2021-04-27T18:03:39Z")

</div>

Hi, I’ve an API and I’m using guardian to authenticate users, I can login correctly, but when I try logout nothing is happening. I’m using this function of Guardian Guardian.revoke/2 I’m passing the connection and the t…

---

## [Shoud I use Guardian with Ueberauth?](https://forum.elixirforum.com/t/shoud-i-use-guardian-with-ueberauth/38233)

<div class="topic-metadata">

**Author:** [@ZastrixArundell](https://forum.elixirforum.com/u/ZastrixArundell)\
**Replies:** 2\
**Last updated:** [March 16, 2021, 11:18pm UTC](https://forum.elixirforum.com/t/shoud-i-use-guardian-with-ueberauth/38233 "2021-03-16T23:18:56Z")

</div>

Hi there, I’ve been off from Elixir for quite a while, recently I started picking it up. I’m making a phoenix application which will use Discord Oauth via Ueberauth as the only way of authentication, so no email/passwor…

---

## [Is there a way to disable the authentication token in the dev enviroment in Guardian?](https://forum.elixirforum.com/t/is-there-a-way-to-disable-the-authentication-token-in-the-dev-enviroment-in-guardian/37446)

<div class="topic-metadata">

**Author:** [@Fernando](https://forum.elixirforum.com/u/Fernando)\
**Replies:** 0\
**Last updated:** [February 9, 2021, 11:39pm UTC](https://forum.elixirforum.com/t/is-there-a-way-to-disable-the-authentication-token-in-the-dev-enviroment-in-guardian/37446 "2021-02-09T23:39:41Z")

</div>

Hello. i’m using Guardian and Guardian DB for my app. Is there a way to disabled the authentication token in dev enviroment. i punt in dev.exs: config :myapp, MyApp.Guardian, nil But still is checking for the token.

---

## [Guardian Authorization & Dializer](https://forum.elixirforum.com/t/guardian-authorization-dializer/35380)

<div class="topic-metadata">

**Author:** [@mushu8](https://forum.elixirforum.com/u/mushu8)\
**Replies:** 2\
**Last updated:** [November 5, 2020, 11:05pm UTC](https://forum.elixirforum.com/t/guardian-authorization-dializer/35380 "2020-11-05T23:05:04Z")

</div>

Hi, I followed some tutorials and read Hex documentation on Guardian authorization but i get a warning on a basic implementation : The @spec for the function does not match the success typing of the function. Function…

---

## [Managing authorization for a specific use-case](https://forum.elixirforum.com/t/managing-authorization-for-a-specific-use-case/34632)

<div class="topic-metadata">

**Author:** [@KekKekington](https://forum.elixirforum.com/u/KekKekington)\
**Replies:** 4\
**Last updated:** [September 29, 2020, 10:47pm UTC](https://forum.elixirforum.com/t/managing-authorization-for-a-specific-use-case/34632 "2020-09-29T22:47:59Z")

</div>

Creating a topic for this since it’s kind of specific and don’t know how to search for it. We have a backend server in Java (specifically Play Framework) which handles everything for our program, except a websocket serv…

---

## [Argument error whenever I try to login](https://forum.elixirforum.com/t/argument-error-whenever-i-try-to-login/14969)

<div class="topic-metadata">

**Author:** [@rickmutua](https://forum.elixirforum.com/u/rickmutua)\
**Replies:** 15\
**Last updated:** [September 18, 2020, 1:04pm UTC](https://forum.elixirforum.com/t/argument-error-whenever-i-try-to-login/14969 "2020-09-18T13:04:28Z")

</div>

\[info\] POST /api/sessions \[debug\] Processing with Chatty.SessionController.create/2 Parameters: %{"email" =\> "email@gmail.com", "password" =\> "\[FILTERED\]"} Pipelines: \[:api\] \[debug\] QUERY OK source="users" db=2.1ms S…

---

## [Authentication Strategy for token based authentication and Refresh tokens](https://forum.elixirforum.com/t/authentication-strategy-for-token-based-authentication-and-refresh-tokens/34012)

<div class="topic-metadata">

**Author:** [@nikolis](https://forum.elixirforum.com/u/nikolis)\
**Replies:** 3\
**Last updated:** [August 28, 2020, 12:33pm UTC](https://forum.elixirforum.com/t/authentication-strategy-for-token-based-authentication-and-refresh-tokens/34012 "2020-08-28T12:33:29Z")

</div>

Hello Fellas, I need to wrap my head around a topic that I do not seem to see through. I am developing a phoenix application which exposes a RestApi that is the primary mean of communication with the Client (an elm app…

---

## [Guardian Vs Pow, which one to chose?](https://forum.elixirforum.com/t/guardian-vs-pow-which-one-to-chose/33848)

<div class="topic-metadata">

**Author:** [@vrajasekhar1](https://forum.elixirforum.com/u/vrajasekhar1)\
**Replies:** 4\
**Last updated:** [August 20, 2020, 10:43am UTC](https://forum.elixirforum.com/t/guardian-vs-pow-which-one-to-chose/33848 "2020-08-20T10:43:14Z")

</div>

Hi All, For authentication, is it a good idea to go with Guardian or Pow? Which one is better and what parameters to consider when choosing one over the other? Thanks, Rajasekhar.

---

## [Using Guardian Library for Authentication btwn Web API and Mobile App](https://forum.elixirforum.com/t/using-guardian-library-for-authentication-btwn-web-api-and-mobile-app/33285)

<div class="topic-metadata">

**Author:** [@Owens](https://forum.elixirforum.com/u/Owens)\
**Replies:** 1\
**Last updated:** [July 24, 2020, 8:40pm UTC](https://forum.elixirforum.com/t/using-guardian-library-for-authentication-btwn-web-api-and-mobile-app/33285 "2020-07-24T20:40:57Z")

</div>

Hello all, I was recommended by the friendly members of the Elixir Slack not to use JWT for authentication as it’s recently been advised against by most people in the security community. See here: Stop using JWT for ses…

---

## [Invalid token in guardian pipeline](https://forum.elixirforum.com/t/invalid-token-in-guardian-pipeline/33032)

<div class="topic-metadata">

**Author:** [@hin101](https://forum.elixirforum.com/u/hin101)\
**Replies:** 0\
**Last updated:** [July 12, 2020, 9:59am UTC](https://forum.elixirforum.com/t/invalid-token-in-guardian-pipeline/33032 "2020-07-12T09:59:31Z")

</div>

I am using Guardian to add authentication in my app. My router.ex file looks like this: defmodule HineshBlogsWeb.Router do use HineshBlogsWeb, :router pipeline :auth do plug HineshBlogs.UserManager.Pipeline …

---

## [Guardian.resource\_from\_claims/1 function always returns nil instead of user](https://forum.elixirforum.com/t/guardian-resource-from-claims-1-function-always-returns-nil-instead-of-user/31687)

<div class="topic-metadata">

**Author:** [@sanals](https://forum.elixirforum.com/u/sanals)\
**Replies:** 7\
**Last updated:** [May 28, 2020, 4:24am UTC](https://forum.elixirforum.com/t/guardian-resource-from-claims-1-function-always-returns-nil-instead-of-user/31687 "2020-05-28T04:24:01Z")

</div>

Hi, I am new to elixir. I have a web app in elixir which is not done by me. I am finding it difficult to understand the code. When ever I try to access an api which requires authentication, it always return “no authoriz…

---

## [What is the correct place to put Guardian files in a typical Phoenix directory structure?](https://forum.elixirforum.com/t/what-is-the-correct-place-to-put-guardian-files-in-a-typical-phoenix-directory-structure/31366)

<div class="topic-metadata">

**Author:** [@theagilecoder](https://forum.elixirforum.com/u/theagilecoder)\
**Replies:** 1\
**Last updated:** [May 9, 2020, 9:46pm UTC](https://forum.elixirforum.com/t/what-is-the-correct-place-to-put-guardian-files-in-a-typical-phoenix-directory-structure/31366 "2020-05-09T21:46:21Z")

</div>

The three files I am confused about are Guardian implementation module Link Guardian pipeline Link Guardian pipeline Error handler Link I have seen different guides put these files in different locations. The official…

---

## [Guardian authenticates a path that isn't found in its scope](https://forum.elixirforum.com/t/guardian-authenticates-a-path-that-isnt-found-in-its-scope/29415)

<div class="topic-metadata">

**Author:** [@PabloG6](https://forum.elixirforum.com/u/PabloG6)\
**Replies:** 3\
**Last updated:** [March 5, 2020, 12:40pm UTC](https://forum.elixirforum.com/t/guardian-authenticates-a-path-that-isnt-found-in-its-scope/29415 "2020-03-05T12:40:42Z")

</div>

I’m writing an api that needs to be authenticated, but a specific path (the create user path) doesn’t need to be authenticated. scope "/", AttoLinkWeb do pipe\_through \[:api\] post "/", UserController, :create …

---

## [Guardian custom header verification instead of Authorization](https://forum.elixirforum.com/t/guardian-custom-header-verification-instead-of-authorization/17587)

<div class="topic-metadata">

**Author:** [@tanweerdev](https://forum.elixirforum.com/u/tanweerdev)\
**Replies:** 1\
**Last updated:** [February 26, 2020, 5:33am UTC](https://forum.elixirforum.com/t/guardian-custom-header-verification-instead-of-authorization/17587 "2020-02-26T05:33:44Z")

</div>

I have two tokens coming to my Endpoint method. one with inside the key of Authorization and another one inside App-token but couldn’t find any docs/support or anything to workaround this. what is the possible workaround…

---

## [Pass in session data to a live view when instigated via a live route?](https://forum.elixirforum.com/t/pass-in-session-data-to-a-live-view-when-instigated-via-a-live-route/21565)

<div class="topic-metadata">

**Author:** [@mitkins](https://forum.elixirforum.com/u/mitkins)\
**Replies:** 12\
**Last updated:** [February 15, 2020, 2:56pm UTC](https://forum.elixirforum.com/t/pass-in-session-data-to-a-live-view-when-instigated-via-a-live-route/21565 "2020-02-15T14:56:29Z")

</div>

Is there any way to pass up session data via a live route to a live view controller? Specifically, I’d like to pass up the current authenticated user. In my mount call I tried to make the following call: current\_user =…

[Next page](https://forum.elixirforum.com/tag/guardian/721.md?match_all_tags=true&page=1&tags%5B%5D=guardian)
