Coder Social home page Coder Social logo

Access Token verification about fosite HOT 8 CLOSED

ory avatar ory commented on April 27, 2024
Access Token verification

from fosite.

Comments (8)

aeneasr avatar aeneasr commented on April 27, 2024

Fosite does not make implications how you handle this because Fosite does not know your requirements and environment. Additionally, OAuth2 does not specify how resource servers validate the issued tokens.

There are multiple ways to handle token validation:

  • Use JWT with asymmetric cryptography
  • Define your own token generation strategy
  • Do a database lookup, using for example Storage.GetAccessTokenSession. This is neccessary if you use token revokation.

Depending on your use case, you can chose one or multiple of the things above. It would however be a good idea to have a validation example in the exemplary app. If you want to, give it a shot and create a PR - that's the best way to learn :)

from fosite.

aeneasr avatar aeneasr commented on April 27, 2024

If you use HMAC as token strategy, a client-side cryptographic validation of the tokens is not possible because you need both the global secret and the client secret. In that case a database lookup would be best.

from fosite.

mfzl avatar mfzl commented on April 27, 2024

I'd definitely send a PR once I figure things out. But I think I might still not be getting the concepts right. I'm very new to OAuth in general, just getting started.

from fosite.

aeneasr avatar aeneasr commented on April 27, 2024

I see :) OAuth2 can be very tricky, especially with so many different workflows and extensions. If you need help, feel free to ask any time.

from fosite.

aeneasr avatar aeneasr commented on April 27, 2024

I took a little time to think about this issue and there must be a standard way for validating tokens. I will think about this issue over the next few days and hopefully come up with a good, extensible solution.

from fosite.

leetal avatar leetal commented on April 27, 2024

I will see if i have time to fix a simple middleware example that is able to validate the token using either a shared secret (via HMAC) or with Certificates (JWT, for more manageable security) in the coming day or two. :)

from fosite.

aeneasr avatar aeneasr commented on April 27, 2024

Nice @leetal !

from fosite.

aeneasr avatar aeneasr commented on April 27, 2024

This will be covered in #31

from fosite.

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.