Curator.SessionKeeper v0.1.0 Curator.SessionKeeper

A module that provides claims based authentication for Elixir applications.

Curator.SessionKeeper provides the framework for using claims in any Elixir application, web based or otherwise, where authentication is required.

Configuration

config :curator_session_keeper, Curator.SessionKeeper,
  serializer: MyApp.Curator.SessionKeeperSerializer,

Summary

Functions

build claims from a resource. The resource will be run through the configured serializer to obtain a value suitable for storage inside the claims

Like build_claims/1 but also add anything found inside the claims map into the built claims

Fetch the configured serializer module

Verify the given claims

Functions

build_claims(resource)
build_claims(any) :: {:ok, map} | {:error, any}

build claims from a resource. The resource will be run through the configured serializer to obtain a value suitable for storage inside the claims.

build_claims(resource, claims)
build_claims(any, map) :: {:ok, map} | {:error, any}

Like build_claims/1 but also add anything found inside the claims map into the built claims.

Example

Curator.SessionKeeper.build_claims(
  user, %{}
)
serializer()
serializer() :: atom

Fetch the configured serializer module

verify_claims(claims)
verify_claims(map) :: {:ok, map} | {:error, any}

Verify the given claims.