Difference between JWT and SAML?

Jamsheer picture Jamsheer · Dec 5, 2014 · Viewed 36.3k times · Source

What are the main difference between JWT (Json Web Token) and SAML? Please suggest me any example of these with spring security. Thanks in advance.

Answer

MvdD picture MvdD · Dec 5, 2014

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.