Skip to Content
API Security in Action
book

API Security in Action

by Neil Madden
January 2021
Intermediate to advanced
576 pages
18h 9m
English
Manning Publications
Content preview from API Security in Action

4 Session cookie authentication

This chapter covers

  • Building a simple web-based client and UI
  • Implementing token-based authentication
  • Using session cookies in an API
  • Preventing cross-site request forgery attacks

So far, you have required API clients to submit a username and password on every API request to enforce authentication. Although simple, this approach has several downsides from both a security and usability point of view. In this chapter, you’ll learn about those downsides and implement an alternative known as token-based authentication, where the username and password are supplied once to a dedicated login endpoint. A time-limited token is then issued to the client that can be used in place of the user’s credentials for subsequent ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced API Security: OAuth 2.0 and Beyond

Advanced API Security: OAuth 2.0 and Beyond

Prabath Siriwardena
Logging in Action

Logging in Action

Phil Wilkins

Publisher Resources

ISBN: 9781617296024Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link