{"id":18078429,"url":"https://github.com/techgaun/jwt-phoenix-sample","last_synced_at":"2025-08-04T06:15:15.927Z","repository":{"id":147048752,"uuid":"85446230","full_name":"techgaun/jwt-phoenix-sample","owner":"techgaun","description":"Sample application for using JWT with Phoenix","archived":false,"fork":false,"pushed_at":"2017-11-16T02:18:19.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T11:58:21.534Z","etag":null,"topics":["elixir","json-web-token","jwt","phoenix-framework"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techgaun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-19T02:41:07.000Z","updated_at":"2018-04-06T18:09:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c26fdf5-2be5-40de-a4e1-3f73b497f6f3","html_url":"https://github.com/techgaun/jwt-phoenix-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techgaun/jwt-phoenix-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fjwt-phoenix-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fjwt-phoenix-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fjwt-phoenix-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fjwt-phoenix-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techgaun","download_url":"https://codeload.github.com/techgaun/jwt-phoenix-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fjwt-phoenix-sample/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268657506,"owners_count":24285515,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["elixir","json-web-token","jwt","phoenix-framework"],"created_at":"2024-10-31T12:13:59.810Z","updated_at":"2025-08-04T06:15:15.888Z","avatar_url":"https://github.com/techgaun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JwtPhoenix\n\nTo start your Phoenix app:\n\n  * Install dependencies with `mix deps.get`\n  * Create and migrate your database with `mix ecto.create \u0026\u0026 mix ecto.migrate`\n  * Start Phoenix endpoint with `mix phoenix.server`\n\nNow you can visit [`localhost:4000`](http://localhost:4000) from your browser.\n\n## Setup\n\nCreate the sample app:\n\n```shell\nmix phoenix.new jwt_phoenix --no-brunch --no-html\n```\n\n## Configuration\n\nYou need to export appropriate variables required for auth0 configuration.\nYou can check [config.exs](config/config.exs#L25-L32) to see that following environment variables are being used.\n\n```shell\n#!/bin/bash\n\nexport AUTH0_BASEURL=\"https://\u003capp\u003e.auth0.com/\"\nexport AUTH0_APP_ID=\"\u003cAPP_ID\u003e\"\nexport AUTH0_APP_SECRET=\"\u003cAPP_SECRET\u003e\"\nmix phoenix.server\n```\n\n## Example\n\nNow, you can send curl requests:\n\n```shell\ncurl http://localhost:4000/api/status # gives 401\ncurl -H \"Authorization: Bearer \u003cvalid_jwt_token\u003e\" http://localhost:4000/api/status # gives 200\n\n# when the token does not have app_metadata containing role admin\ncurl -H \"Authorization: Bearer \u003cjwt_token\u003e\" http://localhost:4000/api/admin # gives 403\n\ncurl -H \"Authorization: Bearer \u003cappropriate_jwt_token\u003e\" http://localhost:4000/api/admin # gives 200\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fjwt-phoenix-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechgaun%2Fjwt-phoenix-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fjwt-phoenix-sample/lists"}