I am trying to implement Single Sign-On service for Node.js applications using WSO2 identity server. I am newbie in SSO domain.

I have deployed the WSO2 identity server locally.

I am using this simple node application as a service provider.

```
var express = require("express");
var passport = require("passport");
var SamlStrategy = require('passport-saml').Strategy;
var bodyParser = require("body-parser");
var session = require("express-session");
var app = express();
app.use(bodyParser.urlencoded({
  extended: true
}));
app.use(session({ secret: 'this shit hits'}));
app.use(passport.initialize());
app.use(passport.session());

var redirectLogin = function (req,res,next) {
   if (!req.isAuthenticated()) {
       res.redirect("/myapp/login");
   }
   next();
}
passport.serializeUser(function(user, done) {
     done(null, user);
});

passport.deserializeUser(function(user, done) {

  done(null, user);
});

passport.use(new SamlStrategy({
    entryPoint: 'https://localhost:9443/samlsso',
    issuer: 'MyAppExpress'
  },
  function(profile, done) {
    var myUser = {
      email : profile.nameID
    }
    done(null, myUser);
  }));

app.get('/myapp/login',
  passport.authenticate('saml', {
    successRedirect: "/myapp",
    failureRedirect: "/myapp/login",
  }));

app.post('/myapp/saml', passport.authenticate('saml', {
    failureRedirect: "/myapp/login",
    failureFlash: true
  })
  ,
  function(req, res) {
    res.redirect("/myapp");
  }
);
app.get("/myapp",redirectLogin, function(req, res) {
    res.send("you're authenticated !!!! "+ JSON.stringify(req.user));
});

app.listen(process.env.PORT || 1234);

```

Service provider configurations on WSO2 identity server are:
[![enter image description here](https://i.stack.imgur.com/edVo5.png)](https://i.stack.imgur.com/edVo5.png)

[![enter image description here](https://i.stack.imgur.com/HA0Pk.png)](https://i.stack.imgur.com/HA0Pk.png)

I have followed guidelines given on this link. 
[SAML Authentication with WSO2 / LDAP / PASSPORT / EXPRESS](http://imatmati.github.io/blog/posts/passport-express-wso2)

Currently, I am facing following issues:

* ALERT: Invalid Assertion Consumer URL value '<http://localhost:1234/saml/consume>' in the AuthnRequest message from the issuer 'MyAppExpress'. Possibly an attempt for a spoofing attack. This is caused when I am trying to login with the admin user[username:admin, password:admin]. This user exists in User data source. [![enter image description here](https://i.stack.imgur.com/IosaG.png)](https://i.stack.imgur.com/IosaG.png)
* Context does not exist. Probably due to invalidated cache. This is caused when I try to login with invalid user

Questions:

* Is there an issue inside the node application.
* or there is an issue with the service provider configurations.