{"id":13507392,"url":"https://github.com/zmoshansky/aeacus","last_synced_at":"2025-10-21T15:51:32.234Z","repository":{"id":34570181,"uuid":"38516269","full_name":"zmoshansky/aeacus","owner":"zmoshansky","description":"A simple, secure, and highly configurable Elixir identity [username | email | id | etc.]/password authentication module to use with Ecto.","archived":false,"fork":false,"pushed_at":"2022-02-02T21:38:53.000Z","size":21,"stargazers_count":37,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T08:19:13.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmoshansky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-04T01:00:44.000Z","updated_at":"2023-04-08T10:10:40.000Z","dependencies_parsed_at":"2022-09-17T04:21:37.557Z","dependency_job_id":null,"html_url":"https://github.com/zmoshansky/aeacus","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoshansky%2Faeacus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoshansky%2Faeacus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoshansky%2Faeacus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmoshansky%2Faeacus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmoshansky","download_url":"https://codeload.github.com/zmoshansky/aeacus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296330,"owners_count":20754625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:00:32.843Z","updated_at":"2025-10-21T15:51:27.170Z","avatar_url":"https://github.com/zmoshansky.png","language":"Elixir","funding_links":[],"categories":["Authentication"],"sub_categories":[],"readme":"[Aeacus - The holder of keys](https://en.wikipedia.org/wiki/Aeacus)\n======\n\nA simple, secure, and highly configurable Elixir identity [username | email | id | etc.]/password authentication module to use with Map compatible data structures (ex.Ecto).\n\n[![Build Status](https://travis-ci.org/zmoshansky/aeacus.svg)](https://travis-ci.org/zmoshansky/aeacus) [![Hex.pm](http://img.shields.io/hexpm/v/aeacus.svg)](https://hex.pm/packages/aeacus) [![Hex.pm](http://img.shields.io/hexpm/dt/aeacus.svg)](https://hex.pm/packages/aeacus) [![Github Issues](http://githubbadges.herokuapp.com/zmoshansky/aeacus/issues.svg)](https://github.com/zmoshansky/aeacus/issues) [![Pending Pull-Requests](http://githubbadges.herokuapp.com/zmoshansky/aeacus/pulls.svg)](https://github.com/zmoshansky/aeacus/pulls)\n\n#### Description ####\nAeacus only performs authentication, making it well suited for integration with session storage, or a token system; like [Guardian](https://github.com/hassox/guardian) or [Phoenix Tokens](http://hexdocs.pm/phoenix/Phoenix.Token.html). For convenience, `authenticate/2` \u0026 `authenticate_resource/3` are delegated from `Aeacus` (`Aeacus.authenticate(...)`).\n\n`Aeacus.hashpwsalt/1` delegates to the underlying crypto system to salt and hash a password.\n\n#### Dependencies ####\nEcto is required only if you wish to use `Aeacus.authenticate/2`; if using `Aeacus.authenticate_resource/3` Ecto is not required.\n\n#### Requirements ####\nAeacus requires that you have a Map compatible data structure (ex. Ecto Model) that has a UNIQUE(identity_field) and password_field. These fields can be configured to easily match your schema, whether it be `username`, `email`, or `pass`, `password`, `hash`, `hashed_password`, etc. Of course, the passwords must be stored using the same crypto system as Aeacus; The password should be salted and hashed, plaintext is heavily discouraged. See the tests for examples.\n\n#### Config ####\nYou must set the `:repo` and `:model` for Aeacus. The other options have sane defaults.\n\n```elixir\nconfig :aeacus, Aeacus,\n  repo: MyApp.Repo,\n  model: MyApp.User,\n  # Optional, The following are the default options\n  crypto: Comeonin.Pbkdf2,\n  identity_field: :email,\n  password_field: :hashed_password,\n  error_message: \"Invalid identity or password.\"\n```\n\n#### Example Session Controller ####\n`Aeacus.authenticate` expects a `Map` with keys `:identity`, and `:password`. Alternatively, `Aeacus.authenticate_resource` can be used if a resource is already loaded.\n\n```elixir\ndefmodule MyApp.SessionController do\n  def create(conn, params) do\n    case Aeacus.authenticate %{identity: params[:email], password: params[:pass]} do\n      {:ok, user} -\u003e CreateTokenOrCookie\n      {:error, message} -\u003e DisplayAuthenticationScreenAgain\n    end\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoshansky%2Faeacus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmoshansky%2Faeacus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmoshansky%2Faeacus/lists"}