{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/8","labels_url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/8/comments","events_url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/8/events","html_url":"https://github.com/auth0/passport-wsfed-saml2/issues/8","id":54458273,"number":8,"title":"An samples showing how to use this Stratergy?","user":{"login":"mithun-daa","id":852171,"avatar_url":"https://avatars.githubusercontent.com/u/852171?v=3","gravatar_id":"","url":"https://api.github.com/users/mithun-daa","html_url":"https://github.com/mithun-daa","followers_url":"https://api.github.com/users/mithun-daa/followers","following_url":"https://api.github.com/users/mithun-daa/following{/other_user}","gists_url":"https://api.github.com/users/mithun-daa/gists{/gist_id}","starred_url":"https://api.github.com/users/mithun-daa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mithun-daa/subscriptions","organizations_url":"https://api.github.com/users/mithun-daa/orgs","repos_url":"https://api.github.com/users/mithun-daa/repos","events_url":"https://api.github.com/users/mithun-daa/events{/privacy}","received_events_url":"https://api.github.com/users/mithun-daa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-15T14:59:22Z","updated_at":"2015-01-15T22:53:37Z","closed_at":null,"body":"I run into the following error when I run my server:\r\n```\r\npassport.use(new wsfedsaml2(\r\n             ^\r\nTypeError: object is not a function\r\n    at Object.<anonymous> (D:\\Playground\\nodeIdSrv\\server.js:7:14)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Function.Module.runMain (module.js:497:10)\r\n    at startup (node.js:119:16)\r\n    at node.js:906:3\r\n```\r\n\r\nHere is my simple server:\r\n```\r\nvar express = require('express');\r\nvar passport = require('passport');\r\nvar wsfedsaml2 = require('passport-wsfed-saml2');\r\nvar app = express();\r\n\r\npassport.use(new wsfedsaml2(\r\n  {\r\n    path: '/login/callback',\r\n    realm: 'urn:node:app',\r\n    homeRealm: '', // optionally specify an identity provider to avoid showing the idp selector\r\n    identityProviderUrl: 'https://auth10-dev.accesscontrol.windows.net/v2/wsfederation',\r\n    cert: 'MIIDFjCCAf6gAwIBAgIQDRRprj9lv5RBvaQdlFltDzANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyRhdXRoMTAtZGV2LmFjY2Vzc2NvbnRyb2wud2luZG93cy5uZXQwHhcNMTEwOTIxMDMzMjMyWhcNMTIwOTIwMDkzMjMyWjAvMS0wKwYDVQQDEyRhdXRoMTAtZGV2LmFjY2Vzc2NvbnRyb2wud2luZG93cy5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCEIAEB/KKT3ehNMy2MQEyJIQ14CnZ8DC2FZgL5Gw3UBSdRb9JinK/gw7yOQtwKfJUqeoZaUSAAdcdbgqwVxOnMBfWiYX7DGlEznSfqYVnjOWjqqjpoe0h6RaOkdWovDtoidmqVV1tWRJFjkj895clPxkLpnqqcycfXtSdZen0SroGyirD2mhMc9ccLbJ3zRnBNjlvpo5zow1zYows09tNC2EhGROL/OS4JNRQnJRICZC+WkA7Igf3xb4btJOzIPYhFiqCGrd/81CHmAyEuNzyc60I5yomDQfZ91Eb5Uk3F7mlfAlYB2aZwDwldLSOlVE8G1E5xFexF/5KyPC4ShNodAgMBAAGjLjAsMAsGA1UdDwQEAwIE8DAdBgNVHQ4EFgQUyYfx/r0czsPgTzitqey+fGMQpkcwDQYJKoZIhvcNAQEFBQADggEBAB5dgQlM3tKS+/cjlvMCPjZH0Iqo/Wxecri3YWi2iVziZ/TQ3dSV+J/iTyduN7rJmFQzTsNERcsgyAwblwnEKXXvlWo8G/+VDIMh3zVPNQFKns5WPkfkhoSVlnZPTQ8zdXAcWgDXbCgvdqIPozdgL+4l0W0XVL1ugA4/hmMXh4TyNd9Qj7MWvlmwVjevpSqN4wG735jAZFHb/L/vvc91uKqP+JvLNj8tPFVxatzi56X1V8jBM61Hx1Z9D0RCDjtmcQVysVEylW9O6mNy6ZrhLm0q5yecWudfBbTKDqRoCHQRjrMU2c5q/ZFDtgjLim7FaNxFbgTyjeRCPclEhfemYVg='\r\n  },\r\n  function(profile, done) {\r\n    findByEmail(profile.email, function(err, user) {\r\n      if (err) {\r\n        return done(err);\r\n      }\r\n      return done(null, user);\r\n    });\r\n  })\r\n);\r\n\r\nvar port = process.env.PORT || 3000;\r\n\r\napp.get('', function(req, res) {\r\n\tres.send(\"Welcome!\");\r\n});\r\n\r\napp.post('/login/callback',\r\n  passport.authenticate('wsfed-saml2', { failureRedirect: '/', failureFlash: true }),\r\n  function(req, res) {\r\n  \tconsole.log(req);\r\n    res.redirect('/');\r\n  }\r\n);\r\n\r\napp.listen(port);\r\nconsole.log('Server started');\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/comments/70178278","html_url":"https://github.com/auth0/passport-wsfed-saml2/issues/8#issuecomment-70178278","issue_url":"https://api.github.com/repos/auth0/passport-wsfed-saml2/issues/8","id":70178278,"user":{"login":"mithun-daa","id":852171,"avatar_url":"https://avatars.githubusercontent.com/u/852171?v=3","gravatar_id":"","url":"https://api.github.com/users/mithun-daa","html_url":"https://github.com/mithun-daa","followers_url":"https://api.github.com/users/mithun-daa/followers","following_url":"https://api.github.com/users/mithun-daa/following{/other_user}","gists_url":"https://api.github.com/users/mithun-daa/gists{/gist_id}","starred_url":"https://api.github.com/users/mithun-daa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mithun-daa/subscriptions","organizations_url":"https://api.github.com/users/mithun-daa/orgs","repos_url":"https://api.github.com/users/mithun-daa/repos","events_url":"https://api.github.com/users/mithun-daa/events{/privacy}","received_events_url":"https://api.github.com/users/mithun-daa/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T22:53:37Z","updated_at":"2015-01-15T22:53:37Z","body":"I did download the examples. First off, I am not using ADFS but using [Thinktecture's Identity Server](https://github.com/thinktecture/Thinktecture.IdentityServer.v1). I don't see why this strategy wouldn't work with it. \r\nI got the *login* example working with the newest version of express and all the middleware but I keep getting stuck in this loop - the login endpoint redirects me to my Identity Server's login page (as expected), after entering my credentials there it posts to the ```/login/callback``` but looks like the \r\n```\r\npassport.authenticate('wsfed-saml2', { failureRedirect: '/', failureFlash: true }),\r\n```\r\nline is redirecting me back to the Identity Server. If I comment that line it doesn't redirect me back to the Identity Server but regardless of what I do I do not see anything in my ```req.user``` - it is always undefined. \r\nAlso, I never seem to hit the callback function while setting up the Strategy:\r\n```\r\npassport.use(new wsfedsaml2(\r\n  {\r\n    path: '/login/callback',\r\n    realm: 'urn:node:app',\r\n    homeRealm: '', // specify an identity provider to avoid showing the idp selector\r\n    identityProviderUrl: 'https://myIdSrv/issue/wsfed',\r\n    thumbprint: 'xxx'\r\n  },\r\n  function(profile, done) {\r\n    console.log(\"Auth with\", profile);\r\n));\r\n```"}}