Identity-Framework / BioNode-Client

WebID Access Control with Biometrics client
4 stars 1 forks source link

Verify WebID #1

Closed corysabol closed 8 years ago

corysabol commented 8 years ago

Verify a given WebID.

corysabol commented 8 years ago

Verify the webid that is supplied once the application is accessed. Please see the following code. It already verifies the webid.

The code should serve two routes, one that is restricted and requires a valid webid to be accessed. The certificate will be in the users session you can see some similar code to what you will need to write here.

webid.verify(sess.cert, function (err, result) {
      if (err || sess.cert == {}) {
          redirect_uri = '/unauthed';
      } else {
          redirect_uri = '/authed'
      }

      console.log(result);
      sess.authed = true;
      console.log(sess.authed);
      req.session = sess;
      res.redirect(redirect_uri);
 });

Where sess is the current session and webid is the webid module.

corysabol commented 8 years ago

Agent auth now implemented as a separate module.