Giter Club home page Giter Club logo

Comments (2)

zbjornson avatar zbjornson commented on May 28, 2024

I think the principle is that the server needs to validate, and the client usually doesn't need to validate (trust the server). Validating would require sending the secret to the client, which would be bad. However, this library has the ability to decode and verify client-side: https://github.com/kjur/jsrsasign/wiki/Tutorial-for-JWT-verification

from angular-jwt.

tiblu avatar tiblu commented on May 28, 2024

I guess taking into account how the JWT-angular is meant to be used, I guess you are right, it's really not part of the library as client does not read and use any sensitive data thus no need to verify the token on the client side. It's up to the dev to realize that jwtHelper.decodeToken does NOT and verify the token and thus result cannot be trusted.

Yes, if the JWT is signed with a secret, I agree, client cannot contain the secret. In case the JWT is signed with a private key, it can be verified in the client side with the signers public key. For example when you implement OpenID Connect Implicit 1.0 flow (http://openid.net/specs/openid-connect-implicit-1_0.html) client needs to verify the callbacks id_token with servers public key. And yes, I used the https://github.com/kjur/jsrsasign for that.

from angular-jwt.

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.