{"action":"created","comment":{"url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/comments/91839327","pull_request_review_id":12351839,"id":91839327,"diff_hunk":"@@ -207,6 +207,29 @@ def post_xml(xml=:example_response, opts = {})\n       end\n     end\n \n+    context \"when using custom user id attribute\" do\n+      before :each do\n+        saml_options[:idp_cert_fingerprint] = \"3B:82:F1:F5:54:FC:A8:FF:12:B8:4B:B8:16:61:1D:E4:8E:9B:E2:3C\"\n+        saml_options[:uid_attribute] = \"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress\"\n+        post_xml :custom_attributes\n+      end\n+\n+      it \"should return user id attribute\" do\n+        expect(auth_hash[:uid]).to eq(\"user@example.com\")\n+      end\n+    end\n+\n+    context \"when using custom user id attribute, but it is missing\" do\n+      before :each do\n+        saml_options[:uid_attribute] = \"missing_attribute\"\n+        post_xml\n+      end\n+\n+      it \"should not return an authenticated session\" do\n+        expect(auth_hash).to eq(nil)","path":"spec/omniauth/strategies/saml_spec.rb","position":23,"original_position":23,"commit_id":"2d879f6437a9ca8684952a0f58e37b8d5632ebc4","original_commit_id":"2d879f6437a9ca8684952a0f58e37b8d5632ebc4","user":{"login":"md5","id":76367,"avatar_url":"https://avatars.githubusercontent.com/u/76367?v=3","gravatar_id":"","url":"https://api.github.com/users/md5","html_url":"https://github.com/md5","followers_url":"https://api.github.com/users/md5/followers","following_url":"https://api.github.com/users/md5/following{/other_user}","gists_url":"https://api.github.com/users/md5/gists{/gist_id}","starred_url":"https://api.github.com/users/md5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md5/subscriptions","organizations_url":"https://api.github.com/users/md5/orgs","repos_url":"https://api.github.com/users/md5/repos","events_url":"https://api.github.com/users/md5/events{/privacy}","received_events_url":"https://api.github.com/users/md5/received_events","type":"User","site_admin":false},"body":"I'm confused about why `auth_hash` is `nil` instead of the `ValidationError` being raised. Does the error get rescued somewhere in the OmniAuth code?","created_at":"2016-12-10T17:57:56Z","updated_at":"2016-12-10T17:58:05Z","html_url":"https://github.com/omniauth/omniauth-saml/pull/121#discussion_r91839327","pull_request_url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121","_links":{"self":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/comments/91839327"},"html":{"href":"https://github.com/omniauth/omniauth-saml/pull/121#discussion_r91839327"},"pull_request":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121"}}},"pull_request":{"url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121","id":96070960,"html_url":"https://github.com/omniauth/omniauth-saml/pull/121","diff_url":"https://github.com/omniauth/omniauth-saml/pull/121.diff","patch_url":"https://github.com/omniauth/omniauth-saml/pull/121.patch","issue_url":"https://api.github.com/repos/omniauth/omniauth-saml/issues/121","number":121,"state":"open","locked":false,"title":"Add `uid_attribute` option to control the attribute used for the user id","user":{"login":"olavmrk","id":349658,"avatar_url":"https://avatars.githubusercontent.com/u/349658?v=3","gravatar_id":"","url":"https://api.github.com/users/olavmrk","html_url":"https://github.com/olavmrk","followers_url":"https://api.github.com/users/olavmrk/followers","following_url":"https://api.github.com/users/olavmrk/following{/other_user}","gists_url":"https://api.github.com/users/olavmrk/gists{/gist_id}","starred_url":"https://api.github.com/users/olavmrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olavmrk/subscriptions","organizations_url":"https://api.github.com/users/olavmrk/orgs","repos_url":"https://api.github.com/users/olavmrk/repos","events_url":"https://api.github.com/users/olavmrk/events{/privacy}","received_events_url":"https://api.github.com/users/olavmrk/received_events","type":"User","site_admin":false},"body":"Some SAML 2.0 IdPs use the transient name identifier format. In that case the name identifier changes for each login, which makes the name identifier unsuitable as a user identifier.\r\n\r\nThis patch introduces the `uid_attribute` option, that allows us to use a SAML 2.0 attribute as the user identifier instead of the name identifier.\r\n\r\nFixes issue #120.\r\n\r\n*Note*: It was suggested in [this issue comment](https://github.com/omniauth/omniauth-saml/issues/120#issuecomment-260744835) that this patch should also make the name identifier optional. I decided to not do that, since that also has implications for logout. I therefore think that makes more sense as a separate patch.","created_at":"2016-12-01T11:26:38Z","updated_at":"2016-12-10T17:58:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95dcdd4ab108329375b34db6a3cc3d40040993b8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121/commits","review_comments_url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121/comments","review_comment_url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/omniauth/omniauth-saml/issues/121/comments","statuses_url":"https://api.github.com/repos/omniauth/omniauth-saml/statuses/2d879f6437a9ca8684952a0f58e37b8d5632ebc4","head":{"label":"UNINETT:add_uid_attribute","ref":"add_uid_attribute","sha":"2d879f6437a9ca8684952a0f58e37b8d5632ebc4","user":{"login":"UNINETT","id":778970,"avatar_url":"https://avatars.githubusercontent.com/u/778970?v=3","gravatar_id":"","url":"https://api.github.com/users/UNINETT","html_url":"https://github.com/UNINETT","followers_url":"https://api.github.com/users/UNINETT/followers","following_url":"https://api.github.com/users/UNINETT/following{/other_user}","gists_url":"https://api.github.com/users/UNINETT/gists{/gist_id}","starred_url":"https://api.github.com/users/UNINETT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNINETT/subscriptions","organizations_url":"https://api.github.com/users/UNINETT/orgs","repos_url":"https://api.github.com/users/UNINETT/repos","events_url":"https://api.github.com/users/UNINETT/events{/privacy}","received_events_url":"https://api.github.com/users/UNINETT/received_events","type":"Organization","site_admin":false},"repo":{"id":75282158,"name":"omniauth-saml","full_name":"UNINETT/omniauth-saml","owner":{"login":"UNINETT","id":778970,"avatar_url":"https://avatars.githubusercontent.com/u/778970?v=3","gravatar_id":"","url":"https://api.github.com/users/UNINETT","html_url":"https://github.com/UNINETT","followers_url":"https://api.github.com/users/UNINETT/followers","following_url":"https://api.github.com/users/UNINETT/following{/other_user}","gists_url":"https://api.github.com/users/UNINETT/gists{/gist_id}","starred_url":"https://api.github.com/users/UNINETT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UNINETT/subscriptions","organizations_url":"https://api.github.com/users/UNINETT/orgs","repos_url":"https://api.github.com/users/UNINETT/repos","events_url":"https://api.github.com/users/UNINETT/events{/privacy}","received_events_url":"https://api.github.com/users/UNINETT/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UNINETT/omniauth-saml","description":"A generic SAML strategy for OmniAuth","fork":true,"url":"https://api.github.com/repos/UNINETT/omniauth-saml","forks_url":"https://api.github.com/repos/UNINETT/omniauth-saml/forks","keys_url":"https://api.github.com/repos/UNINETT/omniauth-saml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UNINETT/omniauth-saml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UNINETT/omniauth-saml/teams","hooks_url":"https://api.github.com/repos/UNINETT/omniauth-saml/hooks","issue_events_url":"https://api.github.com/repos/UNINETT/omniauth-saml/issues/events{/number}","events_url":"https://api.github.com/repos/UNINETT/omniauth-saml/events","assignees_url":"https://api.github.com/repos/UNINETT/omniauth-saml/assignees{/user}","branches_url":"https://api.github.com/repos/UNINETT/omniauth-saml/branches{/branch}","tags_url":"https://api.github.com/repos/UNINETT/omniauth-saml/tags","blobs_url":"https://api.github.com/repos/UNINETT/omniauth-saml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UNINETT/omniauth-saml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UNINETT/omniauth-saml/git/refs{/sha}","trees_url":"https://api.github.com/repos/UNINETT/omniauth-saml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UNINETT/omniauth-saml/statuses/{sha}","languages_url":"https://api.github.com/repos/UNINETT/omniauth-saml/languages","stargazers_url":"https://api.github.com/repos/UNINETT/omniauth-saml/stargazers","contributors_url":"https://api.github.com/repos/UNINETT/omniauth-saml/contributors","subscribers_url":"https://api.github.com/repos/UNINETT/omniauth-saml/subscribers","subscription_url":"https://api.github.com/repos/UNINETT/omniauth-saml/subscription","commits_url":"https://api.github.com/repos/UNINETT/omniauth-saml/commits{/sha}","git_commits_url":"https://api.github.com/repos/UNINETT/omniauth-saml/git/commits{/sha}","comments_url":"https://api.github.com/repos/UNINETT/omniauth-saml/comments{/number}","issue_comment_url":"https://api.github.com/repos/UNINETT/omniauth-saml/issues/comments{/number}","contents_url":"https://api.github.com/repos/UNINETT/omniauth-saml/contents/{+path}","compare_url":"https://api.github.com/repos/UNINETT/omniauth-saml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UNINETT/omniauth-saml/merges","archive_url":"https://api.github.com/repos/UNINETT/omniauth-saml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UNINETT/omniauth-saml/downloads","issues_url":"https://api.github.com/repos/UNINETT/omniauth-saml/issues{/number}","pulls_url":"https://api.github.com/repos/UNINETT/omniauth-saml/pulls{/number}","milestones_url":"https://api.github.com/repos/UNINETT/omniauth-saml/milestones{/number}","notifications_url":"https://api.github.com/repos/UNINETT/omniauth-saml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UNINETT/omniauth-saml/labels{/name}","releases_url":"https://api.github.com/repos/UNINETT/omniauth-saml/releases{/id}","deployments_url":"https://api.github.com/repos/UNINETT/omniauth-saml/deployments","created_at":"2016-12-01T10:33:28Z","updated_at":"2016-12-01T10:33:29Z","pushed_at":"2016-12-01T12:14:22Z","git_url":"git://github.com/UNINETT/omniauth-saml.git","ssh_url":"git@github.com:UNINETT/omniauth-saml.git","clone_url":"https://github.com/UNINETT/omniauth-saml.git","svn_url":"https://github.com/UNINETT/omniauth-saml","homepage":"https://github.com/omniauth/omniauth-saml","size":168,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"omniauth:master","ref":"master","sha":"c946c0a27c9d8016be6d8350c04a17798ceff92b","user":{"login":"omniauth","id":17064356,"avatar_url":"https://avatars.githubusercontent.com/u/17064356?v=3","gravatar_id":"","url":"https://api.github.com/users/omniauth","html_url":"https://github.com/omniauth","followers_url":"https://api.github.com/users/omniauth/followers","following_url":"https://api.github.com/users/omniauth/following{/other_user}","gists_url":"https://api.github.com/users/omniauth/gists{/gist_id}","starred_url":"https://api.github.com/users/omniauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omniauth/subscriptions","organizations_url":"https://api.github.com/users/omniauth/orgs","repos_url":"https://api.github.com/users/omniauth/repos","events_url":"https://api.github.com/users/omniauth/events{/privacy}","received_events_url":"https://api.github.com/users/omniauth/received_events","type":"Organization","site_admin":false},"repo":{"id":3443382,"name":"omniauth-saml","full_name":"omniauth/omniauth-saml","owner":{"login":"omniauth","id":17064356,"avatar_url":"https://avatars.githubusercontent.com/u/17064356?v=3","gravatar_id":"","url":"https://api.github.com/users/omniauth","html_url":"https://github.com/omniauth","followers_url":"https://api.github.com/users/omniauth/followers","following_url":"https://api.github.com/users/omniauth/following{/other_user}","gists_url":"https://api.github.com/users/omniauth/gists{/gist_id}","starred_url":"https://api.github.com/users/omniauth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omniauth/subscriptions","organizations_url":"https://api.github.com/users/omniauth/orgs","repos_url":"https://api.github.com/users/omniauth/repos","events_url":"https://api.github.com/users/omniauth/events{/privacy}","received_events_url":"https://api.github.com/users/omniauth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/omniauth/omniauth-saml","description":"A generic SAML strategy for OmniAuth","fork":false,"url":"https://api.github.com/repos/omniauth/omniauth-saml","forks_url":"https://api.github.com/repos/omniauth/omniauth-saml/forks","keys_url":"https://api.github.com/repos/omniauth/omniauth-saml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omniauth/omniauth-saml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omniauth/omniauth-saml/teams","hooks_url":"https://api.github.com/repos/omniauth/omniauth-saml/hooks","issue_events_url":"https://api.github.com/repos/omniauth/omniauth-saml/issues/events{/number}","events_url":"https://api.github.com/repos/omniauth/omniauth-saml/events","assignees_url":"https://api.github.com/repos/omniauth/omniauth-saml/assignees{/user}","branches_url":"https://api.github.com/repos/omniauth/omniauth-saml/branches{/branch}","tags_url":"https://api.github.com/repos/omniauth/omniauth-saml/tags","blobs_url":"https://api.github.com/repos/omniauth/omniauth-saml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omniauth/omniauth-saml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omniauth/omniauth-saml/git/refs{/sha}","trees_url":"https://api.github.com/repos/omniauth/omniauth-saml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omniauth/omniauth-saml/statuses/{sha}","languages_url":"https://api.github.com/repos/omniauth/omniauth-saml/languages","stargazers_url":"https://api.github.com/repos/omniauth/omniauth-saml/stargazers","contributors_url":"https://api.github.com/repos/omniauth/omniauth-saml/contributors","subscribers_url":"https://api.github.com/repos/omniauth/omniauth-saml/subscribers","subscription_url":"https://api.github.com/repos/omniauth/omniauth-saml/subscription","commits_url":"https://api.github.com/repos/omniauth/omniauth-saml/commits{/sha}","git_commits_url":"https://api.github.com/repos/omniauth/omniauth-saml/git/commits{/sha}","comments_url":"https://api.github.com/repos/omniauth/omniauth-saml/comments{/number}","issue_comment_url":"https://api.github.com/repos/omniauth/omniauth-saml/issues/comments{/number}","contents_url":"https://api.github.com/repos/omniauth/omniauth-saml/contents/{+path}","compare_url":"https://api.github.com/repos/omniauth/omniauth-saml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omniauth/omniauth-saml/merges","archive_url":"https://api.github.com/repos/omniauth/omniauth-saml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omniauth/omniauth-saml/downloads","issues_url":"https://api.github.com/repos/omniauth/omniauth-saml/issues{/number}","pulls_url":"https://api.github.com/repos/omniauth/omniauth-saml/pulls{/number}","milestones_url":"https://api.github.com/repos/omniauth/omniauth-saml/milestones{/number}","notifications_url":"https://api.github.com/repos/omniauth/omniauth-saml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omniauth/omniauth-saml/labels{/name}","releases_url":"https://api.github.com/repos/omniauth/omniauth-saml/releases{/id}","deployments_url":"https://api.github.com/repos/omniauth/omniauth-saml/deployments","created_at":"2012-02-14T20:00:14Z","updated_at":"2016-12-05T20:54:55Z","pushed_at":"2016-12-01T12:14:23Z","git_url":"git://github.com/omniauth/omniauth-saml.git","ssh_url":"git@github.com:omniauth/omniauth-saml.git","clone_url":"https://github.com/omniauth/omniauth-saml.git","svn_url":"https://github.com/omniauth/omniauth-saml","homepage":"https://github.com/omniauth/omniauth-saml","size":289,"stargazers_count":149,"watchers_count":149,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":13,"forks":149,"open_issues":13,"watchers":149,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121"},"html":{"href":"https://github.com/omniauth/omniauth-saml/pull/121"},"issue":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/issues/121"},"comments":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/issues/121/comments"},"review_comments":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121/comments"},"review_comment":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/pulls/121/commits"},"statuses":{"href":"https://api.github.com/repos/omniauth/omniauth-saml/statuses/2d879f6437a9ca8684952a0f58e37b8d5632ebc4"}}}}
{"actor":{"display_login":"md5"}}