Search code examples
samljwt

Difference between JWT and SAML?


What are the main difference between JWT (Json Web Token) and SAML?

Can you suggest me any examples of these with spring security?


Solution

  • Both SAML and JWT are security token formats that are not dependent on any programming language. SAML is the older format and is based on XML. It's used commonly in protocols like SAML-P, WS-Trust and WS-Federation (although not strictly required).

    JWT (JSON Web Token) tokens are based on JSON and used in new authentication and authorization protocols like OpenID Connect and OAuth 2.0.