Full Stackmedium
What are the differences between JWT and OAuth in authentication?
Explain the key differences and use cases for JWT (JSON Web Tokens) and OAuth (Open Authorization) in a full stack application and how they relate to each other.
Asked at Google, Facebook, Amazon
Answer
- JWT is a token format used for stateless authentication.
- OAuth is a protocol that allows third-party applications to access user data without sharing credentials.
- JWT is often used within OAuth as a method to carry information about a user.
- Use JWT for APIs that require frequent interactions. Use OAuth for granting access to external applications.
Source: custom