csurf icon indicating copy to clipboard operation
csurf copied to clipboard

Exposed verify token. Fixes #43.

Open YourDeveloperFriend opened this issue 8 years ago • 15 comments

YourDeveloperFriend avatar Sep 14 '15 21:09 YourDeveloperFriend

Please add some tests and documentation :)

dougwilson avatar Sep 14 '15 21:09 dougwilson

Please add some tests and documentation :)

Done!

YourDeveloperFriend avatar Sep 15 '15 02:09 YourDeveloperFriend

Thanks, looking good! The tests are failing in Node.js 0.12 and up, it looks like. Seems like just an issue in the tests themselves, I would guess.

dougwilson avatar Sep 18 '15 19:09 dougwilson

Awesome, I'll take a look at it in 0.12 and see if I can find out what's going on.

YourDeveloperFriend avatar Sep 21 '15 16:09 YourDeveloperFriend

@YourDeveloperFriend @dougwilson Any update on the status of this PR? Tests seem to be passing and code approved - would be great to have access to this functionality without having to use a forked version. Happy to contribute if there's more work to be done.

camacho avatar Oct 27 '15 19:10 camacho

Hi @camacho , sorry, I didn't realize the issue was addressed, as there was no follow-up comment after "I'll take a look" and GitHub provides no notifications for when new commits are pushed to a PR, so it completely dropped off my radar.

dougwilson avatar Oct 28 '15 01:10 dougwilson

no worries @dougwilson - is there anything additional that needs to be done with this PR?

camacho avatar Oct 28 '15 17:10 camacho

This would be great to get implemented.. would be nice to base64 encode/decode or encrypt tokens during use.

mindvox avatar Jul 17 '16 17:07 mindvox

Is there anything I could do to help move this along? I was about to fork myself to build this exact feature. I would very much prefer to be able to use the upstream library.

JustinLivi avatar Aug 10 '16 01:08 JustinLivi

It was never merged?

alvarotrigo avatar Oct 31 '16 10:10 alvarotrigo

AFAIK there's nothing on my end that needs to happen. Please let me know if there's something that's missing from my PR.

YourDeveloperFriend avatar Oct 31 '16 15:10 YourDeveloperFriend

How about getting this merged in. It has been 2 years...

iofluxdev1 avatar Oct 13 '17 21:10 iofluxdev1

👍 For this feature. My use case is the same as #43 in that I'm validating state within an OAuth callback.

davidjb avatar Apr 19 '18 02:04 davidjb

👍 for this. I also want to use csurf to validate state in an OAuth context.

jamesfiltness avatar May 01 '18 13:05 jamesfiltness

For anyone needing csurf in the context of an OAuth callback you can use the following as a middleware:

const csrfProtection = csrf({
  value: function(req) {
    // grab the csrf token from the query param
    return req.query.state;
  },
  // by default csurf ignores GET requests
  ignoreMethods: ['HEAD', 'OPTIONS'],
});
router.get('/', csrfProtection, require('./kloudless-oauth-callback'));

jamesfiltness avatar May 03 '18 11:05 jamesfiltness