Skip to interview prep
Apexed

What is the difference between authentication and authorization? How do sessions and JWTs compare?

MediumWeb & APIs

Technical

Content review

Report an error

Not yet reviewed

Type or dictate your answer. Your draft is saved on this device.

Show model answer

Authentication proves who you are; authorization decides what you may do.

Server sessions store state on the server and give the client an opaque cookie; they are easy to revoke. JWTs are signed tokens carrying claims, so servers can verify them without a lookup, but revocation is harder, so keep them short-lived and never trust unsigned client data.

What is the difference between authentication and authorization? How do sessions and JWTs compare — Software engineering interview question — Apexed