{"action":"opened","number":879,"pull_request":{"url":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879","id":90522549,"html_url":"https://github.com/tymondesigns/jwt-auth/pull/879","diff_url":"https://github.com/tymondesigns/jwt-auth/pull/879.diff","patch_url":"https://github.com/tymondesigns/jwt-auth/pull/879.patch","issue_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/879","number":879,"state":"open","locked":false,"title":"Issue #877: Accept other fields for id instead of subject","user":{"login":"BrettTrotter","id":3766240,"avatar_url":"https://avatars.githubusercontent.com/u/3766240?v=3","gravatar_id":"","url":"https://api.github.com/users/BrettTrotter","html_url":"https://github.com/BrettTrotter","followers_url":"https://api.github.com/users/BrettTrotter/followers","following_url":"https://api.github.com/users/BrettTrotter/following{/other_user}","gists_url":"https://api.github.com/users/BrettTrotter/gists{/gist_id}","starred_url":"https://api.github.com/users/BrettTrotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrettTrotter/subscriptions","organizations_url":"https://api.github.com/users/BrettTrotter/orgs","repos_url":"https://api.github.com/users/BrettTrotter/repos","events_url":"https://api.github.com/users/BrettTrotter/events{/privacy}","received_events_url":"https://api.github.com/users/BrettTrotter/received_events","type":"User","site_admin":false},"body":"I was hoping to use firebase-compatible tokens for my app, and it seems they need 'sub' to be an email and instead want to use a 'uid' field.\r\n\r\nhttps://firebase.google.com/docs/auth/server/create-custom-tokens\r\n\r\nIf I change my getJwtIdentifier() function to return the email address firebase wants, I can auth with firebase fine, but jwt-auth package is unhappy when it tries to use sub to get the ID back.\r\n\r\nThe code here seems to do the trick, but I don't really like the duplication of the config() calls, but this was the general gist and a quick test with my login and with passing the token I get to firebase seems to work, but there may be more code needed to persist the 'sub' field anyway even if it's not the identifier field anymore?\r\n\r\nAlso FWIW, to work with firebase, I had to set JWT_ALGO to RS256, and set JWT_PUBLIC_KEY to a file path (\\n's in .env don't seem to work) and a JWT_PRIVATE_KEY with a file:// path, and JWT_TTL to 30 minutes (3600 is the Firebase max).\r\n\r\nSetting the new JWT_IDENTIFIER_CLAIM_FIELD env to 'uid' and my getJwtCusomClaims() to\r\n```\r\n\tpublic function getJWTCustomClaims()\r\n\t{\r\n\t\treturn [\r\n\t\t\t'iss' => '******@appspot.gserviceaccount.com',\r\n\t\t\t'sub' => '******@appspot.gserviceaccount.com',\r\n\t\t\t'aud' => 'https://identitytoolkit.googleapis.com/google.identity.identitytoolkit.v1.IdentityToolkit',\r\n\t\t\t'uid' => $this->getKey()\r\n\t\t];\r\n\t}\r\n```\r\n\r\nseems to get me up and going... I fully understand if this isn't the way you wish to implement.","created_at":"2016-10-23T17:33:34Z","updated_at":"2016-10-23T17:33:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879/commits","review_comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879/comments","review_comment_url":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/879/comments","statuses_url":"https://api.github.com/repos/tymondesigns/jwt-auth/statuses/2fc6f5cbab415ff0c2b717afab8ee4591b11d78a","head":{"label":"BrettTrotter:develop","ref":"develop","sha":"2fc6f5cbab415ff0c2b717afab8ee4591b11d78a","user":{"login":"BrettTrotter","id":3766240,"avatar_url":"https://avatars.githubusercontent.com/u/3766240?v=3","gravatar_id":"","url":"https://api.github.com/users/BrettTrotter","html_url":"https://github.com/BrettTrotter","followers_url":"https://api.github.com/users/BrettTrotter/followers","following_url":"https://api.github.com/users/BrettTrotter/following{/other_user}","gists_url":"https://api.github.com/users/BrettTrotter/gists{/gist_id}","starred_url":"https://api.github.com/users/BrettTrotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrettTrotter/subscriptions","organizations_url":"https://api.github.com/users/BrettTrotter/orgs","repos_url":"https://api.github.com/users/BrettTrotter/repos","events_url":"https://api.github.com/users/BrettTrotter/events{/privacy}","received_events_url":"https://api.github.com/users/BrettTrotter/received_events","type":"User","site_admin":false},"repo":{"id":71715949,"name":"jwt-auth","full_name":"BrettTrotter/jwt-auth","owner":{"login":"BrettTrotter","id":3766240,"avatar_url":"https://avatars.githubusercontent.com/u/3766240?v=3","gravatar_id":"","url":"https://api.github.com/users/BrettTrotter","html_url":"https://github.com/BrettTrotter","followers_url":"https://api.github.com/users/BrettTrotter/followers","following_url":"https://api.github.com/users/BrettTrotter/following{/other_user}","gists_url":"https://api.github.com/users/BrettTrotter/gists{/gist_id}","starred_url":"https://api.github.com/users/BrettTrotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrettTrotter/subscriptions","organizations_url":"https://api.github.com/users/BrettTrotter/orgs","repos_url":"https://api.github.com/users/BrettTrotter/repos","events_url":"https://api.github.com/users/BrettTrotter/events{/privacy}","received_events_url":"https://api.github.com/users/BrettTrotter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BrettTrotter/jwt-auth","description":"JSON Web Token Authentication for Laravel & Lumen","fork":true,"url":"https://api.github.com/repos/BrettTrotter/jwt-auth","forks_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/forks","keys_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/teams","hooks_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/hooks","issue_events_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/issues/events{/number}","events_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/events","assignees_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/assignees{/user}","branches_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/branches{/branch}","tags_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/tags","blobs_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/languages","stargazers_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/stargazers","contributors_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/contributors","subscribers_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/subscribers","subscription_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/subscription","commits_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/contents/{+path}","compare_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/merges","archive_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/downloads","issues_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/issues{/number}","pulls_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/labels{/name}","releases_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/releases{/id}","deployments_url":"https://api.github.com/repos/BrettTrotter/jwt-auth/deployments","created_at":"2016-10-23T16:45:18Z","updated_at":"2016-10-23T16:45:20Z","pushed_at":"2016-10-23T17:32:13Z","git_url":"git://github.com/BrettTrotter/jwt-auth.git","ssh_url":"git@github.com:BrettTrotter/jwt-auth.git","clone_url":"https://github.com/BrettTrotter/jwt-auth.git","svn_url":"https://github.com/BrettTrotter/jwt-auth","homepage":"","size":1859,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"tymondesigns:develop","ref":"develop","sha":"804abb0fb619e72e5bfab1c138fe373c74426ed6","user":{"login":"tymondesigns","id":1801923,"avatar_url":"https://avatars.githubusercontent.com/u/1801923?v=3","gravatar_id":"","url":"https://api.github.com/users/tymondesigns","html_url":"https://github.com/tymondesigns","followers_url":"https://api.github.com/users/tymondesigns/followers","following_url":"https://api.github.com/users/tymondesigns/following{/other_user}","gists_url":"https://api.github.com/users/tymondesigns/gists{/gist_id}","starred_url":"https://api.github.com/users/tymondesigns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymondesigns/subscriptions","organizations_url":"https://api.github.com/users/tymondesigns/orgs","repos_url":"https://api.github.com/users/tymondesigns/repos","events_url":"https://api.github.com/users/tymondesigns/events{/privacy}","received_events_url":"https://api.github.com/users/tymondesigns/received_events","type":"User","site_admin":false},"repo":{"id":23680678,"name":"jwt-auth","full_name":"tymondesigns/jwt-auth","owner":{"login":"tymondesigns","id":1801923,"avatar_url":"https://avatars.githubusercontent.com/u/1801923?v=3","gravatar_id":"","url":"https://api.github.com/users/tymondesigns","html_url":"https://github.com/tymondesigns","followers_url":"https://api.github.com/users/tymondesigns/followers","following_url":"https://api.github.com/users/tymondesigns/following{/other_user}","gists_url":"https://api.github.com/users/tymondesigns/gists{/gist_id}","starred_url":"https://api.github.com/users/tymondesigns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tymondesigns/subscriptions","organizations_url":"https://api.github.com/users/tymondesigns/orgs","repos_url":"https://api.github.com/users/tymondesigns/repos","events_url":"https://api.github.com/users/tymondesigns/events{/privacy}","received_events_url":"https://api.github.com/users/tymondesigns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tymondesigns/jwt-auth","description":"JSON Web Token Authentication for Laravel & Lumen","fork":false,"url":"https://api.github.com/repos/tymondesigns/jwt-auth","forks_url":"https://api.github.com/repos/tymondesigns/jwt-auth/forks","keys_url":"https://api.github.com/repos/tymondesigns/jwt-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tymondesigns/jwt-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tymondesigns/jwt-auth/teams","hooks_url":"https://api.github.com/repos/tymondesigns/jwt-auth/hooks","issue_events_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/events{/number}","events_url":"https://api.github.com/repos/tymondesigns/jwt-auth/events","assignees_url":"https://api.github.com/repos/tymondesigns/jwt-auth/assignees{/user}","branches_url":"https://api.github.com/repos/tymondesigns/jwt-auth/branches{/branch}","tags_url":"https://api.github.com/repos/tymondesigns/jwt-auth/tags","blobs_url":"https://api.github.com/repos/tymondesigns/jwt-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tymondesigns/jwt-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tymondesigns/jwt-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/tymondesigns/jwt-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tymondesigns/jwt-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/tymondesigns/jwt-auth/languages","stargazers_url":"https://api.github.com/repos/tymondesigns/jwt-auth/stargazers","contributors_url":"https://api.github.com/repos/tymondesigns/jwt-auth/contributors","subscribers_url":"https://api.github.com/repos/tymondesigns/jwt-auth/subscribers","subscription_url":"https://api.github.com/repos/tymondesigns/jwt-auth/subscription","commits_url":"https://api.github.com/repos/tymondesigns/jwt-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/tymondesigns/jwt-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/tymondesigns/jwt-auth/contents/{+path}","compare_url":"https://api.github.com/repos/tymondesigns/jwt-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tymondesigns/jwt-auth/merges","archive_url":"https://api.github.com/repos/tymondesigns/jwt-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tymondesigns/jwt-auth/downloads","issues_url":"https://api.github.com/repos/tymondesigns/jwt-auth/issues{/number}","pulls_url":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/tymondesigns/jwt-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/tymondesigns/jwt-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tymondesigns/jwt-auth/labels{/name}","releases_url":"https://api.github.com/repos/tymondesigns/jwt-auth/releases{/id}","deployments_url":"https://api.github.com/repos/tymondesigns/jwt-auth/deployments","created_at":"2014-09-04T21:50:50Z","updated_at":"2016-10-23T11:48:45Z","pushed_at":"2016-10-23T17:33:34Z","git_url":"git://github.com/tymondesigns/jwt-auth.git","ssh_url":"git@github.com:tymondesigns/jwt-auth.git","clone_url":"https://github.com/tymondesigns/jwt-auth.git","svn_url":"https://github.com/tymondesigns/jwt-auth","homepage":"","size":1859,"stargazers_count":2695,"watchers_count":2695,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":354,"mirror_url":null,"open_issues_count":154,"forks":354,"open_issues":154,"watchers":2695,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879"},"html":{"href":"https://github.com/tymondesigns/jwt-auth/pull/879"},"issue":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/879"},"comments":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/issues/879/comments"},"review_comments":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879/comments"},"review_comment":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/pulls/879/commits"},"statuses":{"href":"https://api.github.com/repos/tymondesigns/jwt-auth/statuses/2fc6f5cbab415ff0c2b717afab8ee4591b11d78a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":22,"deletions":5,"changed_files":6}}
{"actor":{"display_login":"BrettTrotter"}}