{"action":"created","issue":{"url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/32","repository_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable","labels_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/32/comments","events_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/32/events","html_url":"https://github.com/apokalipto/devise_saml_authenticatable/issues/32","id":122153835,"number":32,"title":"Completed 401 Unauthorized in 60ms","user":{"login":"aaani","id":3347504,"avatar_url":"https://avatars.githubusercontent.com/u/3347504?v=3","gravatar_id":"","url":"https://api.github.com/users/aaani","html_url":"https://github.com/aaani","followers_url":"https://api.github.com/users/aaani/followers","following_url":"https://api.github.com/users/aaani/following{/other_user}","gists_url":"https://api.github.com/users/aaani/gists{/gist_id}","starred_url":"https://api.github.com/users/aaani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaani/subscriptions","organizations_url":"https://api.github.com/users/aaani/orgs","repos_url":"https://api.github.com/users/aaani/repos","events_url":"https://api.github.com/users/aaani/events{/privacy}","received_events_url":"https://api.github.com/users/aaani/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-14T23:12:10Z","updated_at":"2016-05-31T11:58:16Z","closed_at":"2015-12-17T02:02:47Z","body":"I am using the default setup as shown in the documentation but I am getting the following error in my app:\r\n```\r\nCompleted 401 Unauthorized in 60ms\r\n```\r\nEverything is good on my IDP service's end. It authenticates the user successfully and posts response to /saml/consume route. In console I can see that it's sending the appropriate data\r\n```\r\n#<OneLogin::RubySaml::Attributes:0x007ffa9acd1990 @attributes={\"LastName\"=>[\"Mishra\"], \"FirstName\"=>[\"Ani\"], \"EmailAddress\"=>[\"anirvana@xyzemail.me\"]}>\r\n```\r\nMy attibute-map.yml looks like this:\r\n```\r\n  # attribute-map.yml\r\n  \"EmailAddress\": \"email\"\r\n  \"LastName\": \"last_name\"\r\n  \"FirstName\": \"first_name\"\r\n```\r\nand user is created/updated with above attributes properly in **mongodb** via **mongoid**.\r\n\r\nIn my /saml/consume route I redirect the user to /business (which has the devise's default authenticate_user before_filter) and this where I get the 401 status.\r\n\r\nI am using rails-4.2.4, devise-3.4.1, devise_saml_authenticatable-1.2.1 and mongoid-5.0.0\r\n\r\nAny kind of help in debugging this is appreciated. Thanks!"},"comment":{"url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/comments/222667567","html_url":"https://github.com/apokalipto/devise_saml_authenticatable/issues/32#issuecomment-222667567","issue_url":"https://api.github.com/repos/apokalipto/devise_saml_authenticatable/issues/32","id":222667567,"user":{"login":"naveedtariq","id":384665,"avatar_url":"https://avatars.githubusercontent.com/u/384665?v=3","gravatar_id":"","url":"https://api.github.com/users/naveedtariq","html_url":"https://github.com/naveedtariq","followers_url":"https://api.github.com/users/naveedtariq/followers","following_url":"https://api.github.com/users/naveedtariq/following{/other_user}","gists_url":"https://api.github.com/users/naveedtariq/gists{/gist_id}","starred_url":"https://api.github.com/users/naveedtariq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naveedtariq/subscriptions","organizations_url":"https://api.github.com/users/naveedtariq/orgs","repos_url":"https://api.github.com/users/naveedtariq/repos","events_url":"https://api.github.com/users/naveedtariq/events{/privacy}","received_events_url":"https://api.github.com/users/naveedtariq/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T11:58:15Z","updated_at":"2016-05-31T11:58:15Z","body":"@adamstegman @apokalipto @aaani hey guys I am stuck in the same issue from long time, I would really appreciate if you please put me on some right track. I am doing it using Onelogin and my system is IDP based. So I make a post request from my Idp ( Onelogin ) to `saml/auth` it found the user but I am not sure why it is not authenticating the user.\r\n\r\nMy routes file\r\n\r\n```ruby\r\n  devise_scope :user do\r\n    scope \"users\", controller: 'saml_sessions' do\r\n      get :new, path: \"saml/sign_in\", as: :new_user_sso_session\r\n      post :create, path: \"saml/auth\", as: :user_sso_session\r\n      get :destroy, path: \"sign_out\", as: :destroy_user_sso_session\r\n      get :metadata, path: \"saml/metadata\", as: :metadata_user_sso_session\r\n      match :idp_sign_out, path: \"saml/idp_sign_out\", via: [:get, :post]\r\n    end\r\n  end\r\n```\r\n\r\nConfigurations in devise.rb\r\n\r\n```ruby\r\n\r\n  config.saml_configure do |settings|\r\n    settings.assertion_consumer_service_url     = \"#{ENV['HOST']}users/saml/auth\"\r\n    settings.assertion_consumer_service_binding = \"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\"\r\n    settings.name_identifier_format             = \"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"\r\n    settings.issuer                             = \"https://myapp.onelogin.com/saml/metadata/551135\"\r\n    settings.authn_context                      = \"\"\r\n    # settings.idp_entity_id                      = \"https://app.onelogin.com/saml/metadata/551135\"\r\n    settings.idp_slo_target_url                 = \"https://myapp.onelogin.com/trust/saml2/http-redirect/slo/551135\"\r\n    settings.idp_sso_target_url                 = \"https://myapp.onelogin.com/trust/saml2/http-post/sso/551135\"\r\n    settings.idp_cert                           = <<-CERT.chomp\r\n-----BEGIN CERTIFICATE-----\r\nQrKVf+4l0h7kUsWKPWNWU4FlSLeWffdVA0EFe1nPiK8QhLBMevJGcSG7xg8MqiVb\r\noVOBNGDqWe/q5TVJJsONr1Sok1ASdUgfs6TpNTD9/+kza/qPwcb9IzBNI/052QeY\r\nPg==\r\n-----END CERTIFICATE-----\r\n\r\n    CERT\r\n  end\r\n```\r\n\r\nAttribute-map.yml\r\n\r\n```ruby\r\n\"urn:mace:dir:attribute-def:uid\": \"user_name\"\r\n\"urn:mace:dir:attribute-def:email\": \"email\"\r\n\"urn:mace:dir:attribute-def:name\": \"last_name\"\r\n\"urn:mace:dir:attribute-def:givenName\": \"first_name\"\r\n```\r\n\r\nI have seen in XML I am getting the email with which I guess it is finding the user but not sure why user is not getting authenticated. It would be great if you guys please share some knowledge. \r\n\r\nThanks\r\n"}}
{"actor":{"display_login":"naveedtariq"}}