Git Product home page Git Product logo

Comments (5)

leastprivilege avatar leastprivilege commented on May 28, 2024

no

from identityserver3.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on May 28, 2024

Well - to qualify that - it supports the standard Katana extensibility to read the token from wherever you like.

from identityserver3.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on May 28, 2024

Tokens as cookies sounds wrong to me btw

from identityserver3.accesstokenvalidation.

danielbsig avatar danielbsig commented on May 28, 2024

Thanks for the clarification.

As for the reason why I'm considering putting the token in a cookie (we're currently placing it in the Authorization header), then it is twofold:

a) We want to allow users to download files via our API. The links should not be open to anyone, both because we want to control who can download what, and also because we want to track who has downloaded what. Downloading files via Ajax seems to be troublesome on older browsers, so the ability to expose links to our API directly seems to be a better option. This of course means that we cannot manipulate the HTTP headers for those links on the client side, i.e. we cannot add the Authorization header before the user clicks the link. I'm aware of the option to use query string tokens, but this also seems dirty to me (what if the users start sending download links to each other? What will the user experience be when the tokens are expired when the user clicks the link? Etc.)

b) I would like to ensure that 3rd party tools and macros (such as in Excel) written by users will have access to our API. The easiest option for that seems to be to use cookies, but please correct me if I'm wrong.

We would of course take measures to avoid CSRF (there are some methods outlined here: https://stormpath.com/blog/where-to-store-your-jwts-cookies-vs-html5-web-storage/).

Again, I'm simply trying to get the big picture of what seems the best option. Any arguments for or against cookies would be most welcome :-)

Daníel

from identityserver3.accesstokenvalidation.

leastprivilege avatar leastprivilege commented on May 28, 2024

OK - if you are fully aware of the gotchas (mostly CSRF) then cookies are acceptable.

I am not aware of a CSRF protection though that would work without headers.

from identityserver3.accesstokenvalidation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.