{"id":28388814,"url":"https://github.com/ueberauth/guardian_paseto","last_synced_at":"2026-01-17T12:33:29.838Z","repository":{"id":57503905,"uuid":"142230257","full_name":"ueberauth/guardian_paseto","owner":"ueberauth","description":"A Guardian.Token implementation for Paseto tokens (https://paseto.io)","archived":false,"fork":false,"pushed_at":"2021-10-19T19:04:33.000Z","size":59,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-01-14T07:31:30.004Z","etag":null,"topics":["authentication","elixir","guardian","paseto"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ueberauth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2018-07-25T01:18:38.000Z","updated_at":"2024-06-26T08:54:17.000Z","dependencies_parsed_at":"2022-08-28T02:01:13.340Z","dependency_job_id":null,"html_url":"https://github.com/ueberauth/guardian_paseto","commit_stats":null,"previous_names":["grappigpanda/guardian_paseto"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ueberauth/guardian_paseto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_paseto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_paseto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_paseto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_paseto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueberauth","download_url":"https://codeload.github.com/ueberauth/guardian_paseto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_paseto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["authentication","elixir","guardian","paseto"],"created_at":"2025-05-30T23:15:52.608Z","updated_at":"2026-01-17T12:33:29.828Z","avatar_url":"https://github.com/ueberauth.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GuardianPaseto\n\n[![Hex.pm](https://img.shields.io/hexpm/v/guardian_paseto.svg)](https://hex.pm/packages/guardian_paseto)\n\nDocs can be found [Here](https://hexdocs.pm/guardian_paseto/api-reference.html)\n\n## Considerations for using this library\n\nThere are a few library/binary requirements required in order for the Paseto\nlibrary to work on any computer:\n1. Erlang version \u003e= 20.1\n    * This is required because this was the first Erlang version to introduce\n      crypto:sign/5.\n2. libsodium \u003e= 1.0.13\n    * This is required for cryptography used in Paseto.\n    * This can be found at https://github.com/jedisct1/libsodium\n3. openssl \u003e= 1.1\n    * This is needed for XChaCha-Poly1305 used for V2.Local Paseto\n\n## How to use\n\nNOTE: This was basically 100% plagiarized from the Guardian documentation, so, for further configuration options, please visit their documentation at: [Guardian](https://github.com/ueberauth/guardian)\n\nGuardian requires that you create an \"Implementation Module\". This module is your applications implementation for a particular type/configuration of token. You do this by `use`ing Guardian in your module and adding the relevant configuration.\n\nAdd Guardian to your application\n\nmix.exs\n\n```elixir\ndefp deps do\n  [\n    {:guardian, \"~\u003e 1.0\"},\n    {:guardian_paseto, \"~\u003e 0.2.1\"}\n  ]\nend\n```\n\nCreate a module that uses `Guardian`\n\n```elixir\ndefmodule MyApp.Guardian do\n  use Guardian, otp_app: :my_app\n\n  def subject_for_token(resource, _claims) do\n    # You can use any value for the subject of your token but\n    # it should be useful in retrieving the resource later, see\n    # how it being used on `resource_from_claims/1` function.\n    # A unique `id` is a good subject, a non-unique email address\n    # is a poor subject.\n    sub = to_string(resource.id)\n    {:ok, sub}\n  end\n  def subject_for_token(_, _) do\n    {:error, :reason_for_error}\n  end\n\n  def resource_from_claims(claims) do\n    # Here we'll look up our resource from the claims, the subject can be\n    # found in the `\"sub\"` key. In `above subject_for_token/2` we returned\n    # the resource id so here we'll rely on that to look it up.\n    id = claims[\"sub\"]\n    resource = MyApp.get_resource_by_id(id)\n    {:ok,  resource}\n  end\n  def resource_from_claims(_claims) do\n    {:error, :reason_for_error}\n  end\nend\n```\n\nAdd your configuration\n\n```elixir\nconfig :my_app, MyApp.Guardian,\n       issuer: \"my_app\",\n       secret_key: \"Secret key. You can use `:crypto.strong_rand_bytes(32)` to get one\"\n       allowed_algos: :v2_local\n```\n\nWith this level of configuration, you can have a working installation.\n\n## Installation\n\nThis package can be installed by adding `guardian_paseto` to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:guardian_paseto, \"~\u003e 0.2.1\"}\n  ]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fguardian_paseto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueberauth%2Fguardian_paseto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fguardian_paseto/lists"}