{"id":28388817,"url":"https://github.com/ueberauth/guardian_jwe","last_synced_at":"2025-07-17T06:33:25.878Z","repository":{"id":83798294,"uuid":"123392739","full_name":"ueberauth/guardian_jwe","owner":"ueberauth","description":null,"archived":false,"fork":false,"pushed_at":"2021-10-17T18:06:05.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-27T07:40:27.023Z","etag":null,"topics":["guardian","jwe"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-01T06:30:09.000Z","updated_at":"2022-08-27T13:25:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0c07d86-42d5-4bc9-849d-efe8d37453dd","html_url":"https://github.com/ueberauth/guardian_jwe","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ueberauth/guardian_jwe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_jwe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_jwe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_jwe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_jwe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueberauth","download_url":"https://codeload.github.com/ueberauth/guardian_jwe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fguardian_jwe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265573513,"owners_count":23790453,"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":["guardian","jwe"],"created_at":"2025-05-30T23:15:54.093Z","updated_at":"2025-07-17T06:33:25.869Z","avatar_url":"https://github.com/ueberauth.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guardian.Token.Jwe [![Hex.pm](https://img.shields.io/hexpm/v/guardian_jwe.svg)](https://hex.pm/packages/guardian_jwe)\n\nThis package is a plugin for [Guardian](https://hex.pm/packages/guardian).\n\n## Documentation\n\nAPI documentation is available at [https://hexdocs.pm/guardian_jwe](https://hexdocs.pm/guardian_jwe)\n\n## Installation\n\nTo install `Guardian.Token.Jwe`, first add it to your `mix.exs` file:\n\n```elixir\ndef deps do\n  [\n    {:guardian_jwe, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\nTo use JWEs, you'll need to configure the `token_module` parameter in your Guardian implementation module.\n\n```elixir\ndefmodule GuardianTest.Auth do\n  use Guardian,\n    otp_app: :guardian_test,\n    token_module: Guardian.Token.Jwe\n\n  def subject_for_token(resource, _claims) do\n    sub = to_string(resource.id)\n\n    {:ok, sub}\n  end\n\n  def resource_from_claims(claims) do\n    {:ok, claims}\n  end\nend\n```\n\nTo change the default algorithm used to encrypt JWEs, set the `allowed_algos` in your Guardian configuration:\n\n```elixir\nconfig :guardian_test, GuardianTest.Auth,\n       issuer: \"guardian_test\",\n       allowed_algos: [\"A128GCMKW\"],\n       secret_key: \"aaaaaaaaaaaaaaaa\"\n```\n\nThe JWE module uses the same claims and validations as JWT for verification.  With this configuration, your application should work without additional changes to your Guardian configuration.\n\n## Implemented algorithms\n\nCurrently, this package supports the following algorithms for encrypting JWT tokens.\n\n```\nA128GCMKW\nA192GCMKW\nA256GCMKW\n\nPBES2-HS256+A128KW\nPBES2-HS384+A192KW\nPBES2-HS512+A256KW\n```\n\nEach of the `AxxxGCMKW` require keys of specific bit sizes where the `xxx` corresponds to the required size of the key.\n\nThe `PBES2-HSxxx+AxxxKW` secret can be generated using `mix guardian.gen.secret`.\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/guardian_jwe](https://hexdocs.pm/guardian_jwe).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fguardian_jwe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueberauth%2Fguardian_jwe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fguardian_jwe/lists"}