How to make Guardian detect token in a second app, system2system?

318 views Asked by At

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?
0

There are 0 answers