View Source Flowy.Utils.JwtToken (Flowy v0.1.0)

This module is responsible for decoding and verifying a JWT token

Summary

Functions

Decodes and verifies a JWT token using the public keys found in the JWKS endpoint

Fetches the public keys from the JWKS endpoint

Signs a JWT token using the private key found in the PEM file This is mainly used to generate a token for testing purposes

Signs a JWT token using the private key found in the PEM file

Functions

Link to this function

decode(context, opts \\ [])

View Source
@spec decode(
  Flowy.Utils.JwtToken.Context.t(),
  keyword()
) :: {:error, String.t()} | {:ok, map()}
Link to this function

decode_and_validate(context, opts \\ [])

View Source
@spec decode_and_validate(
  Flowy.Utils.JwtToken.Context.t(),
  keyword()
) :: {:error, String.t()} | {:ok, map()}

Decodes and verifies a JWT token using the public keys found in the JWKS endpoint

@spec public_keys(keyword()) :: map()

Fetches the public keys from the JWKS endpoint

@spec public_keys_url(keyword()) :: String.t()
@spec sign() :: {:ok, String.t(), map()}

Signs a JWT token using the private key found in the PEM file This is mainly used to generate a token for testing purposes

@spec sign!() :: String.t()

Signs a JWT token using the private key found in the PEM file