2

I cannot get an app to find the generated token of another app. Both apps (App1 and App2) live in an umbrella, and share the same config and secret-key.

I have my user authentication set up in sessions, the Guardian token is found through:

plug Guardian.Plug.VerifySession
plug Guardian.Plug.LoadResource

The token is found in the generating app "App1". However, when I implement the same Guardian config with the same secret-key in "App2", App2 cannot find the token generated by App1.

My config:

config :guardian, Guardian,
  allowed_algos: ["HS512"],
  verify_module: Guardian.JWT,
  issuer: "Umbrella",
  ttl: { 1, :days },
  allowed_drift: 2000,
  verify_issuer: true,
  secret_key: "theonesecretkey",
  serializer: Umbrella.App2.GuardianSerializer

App2 serializer is replaced by App1 serializer in App1.

(I am using the current Guardian, 0.14; together with Phoenix 1.2.1.)

Edit: Furthermore, App1 and App2 are supposed to run on different servers later on.

  • How can I get App2 to detect and use the token generated by App1?
  • Which (additional) parts do I need to connect, so that it works?
Martin
  • 47
  • 4
  • Not sure if you read this article, but it looks relevant to your issue. http://hassox.github.io/elixir/guardian/2015/06/19/guardian-getting-started.html – ipatch Jan 08 '17 at 02:38
  • I still haven't figured it out, I will try later whether it could work via API-authentication. But thank thank you for your answer. – Martin Jan 21 '17 at 18:02

0 Answers0