Packages

🔌 An Auth0 plug for Elixir meant to help you decode and user Auth0 JWKs

Current section

Files

Jump to
auth0_jwks lib user_info.ex
Raw

lib/user_info.ex

defmodule Auth0Jwks.UserInfo do
use HTTPoison.Base
def from_token(token) do
auth_header = {"Authorization", "Bearer #{token}"}
with {:ok, response} <- get("userinfo", [auth_header]) do
response
|> Map.get(:body)
|> Poison.decode()
end
end
def process_url(path), do: Auth0Jwks.Config.iss() <> path
end