Back to Developer Roadmap

Session Based Authentication in API Design

src/data/roadmaps/api-design/content/session-based-auth@eQWoy4CpYP3TJL2bbhPB_.md

4.01.2 KB
Original Source

Session Based Authentication in API Design

Application Programming Interfaces (APIs) are critical for building software applications. Among several key considerations during API design, one is deciding how to implement authentication and security. Session Based Authentication is one popular way to apply security in API design.

This method revolves around the server creating a session for the user after they successfully log in, associating it with a session identifier. This Session ID is then stored client-side within a cookie. On subsequent requests, the server validates the Session ID before processing the API call. The server will destroy the session after the user logs out, thereby invalidating the Session ID.

Understanding Session Based Authentication is crucial for secure API design, especially in scenarios where security is a top priority or in legacy systems where this method is prevalent.

Visit the following resources to learn more: