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
Link to this function
get_claim(arg1, claim)
View Source
get_claim(Plug.Conn.t | Joken.Token.t, String.t) :: String.t | nil
Pulls given claim
from the Joken token