keycloak v0.2.0 Keycloak.Claims View Source

A helper module for extracting claims from the %Joken.Token{}. In order to use these helpers, you must have the VerifyToken plug in your plug pipeline.

Example

Phoenix controller

def index(conn, _) do
  sub = Keycloak.Claims.get_claim(conn, "sub")

  conn
  |> put_session(:user, sub)
  |> render("index.html")
end

Link to this section Summary

Functions

Pulls given claim from the Joken token

Link to this section Functions

Pulls given claim from the Joken token