<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/eWzNuhyhk" -->

---
title: Different ways to authenticate your APIs | daily.dev
description: Using basic authentication for authenticating users is usually not recommended since sending the user credentials for every request is a bad practice. API keys...
canonical: https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Different ways to authenticate your APIs | daily.dev
og:description: Using basic authentication for authenticating users is usually not recommended since sending the user credentials for every request is a bad practice. API keys...
og:url: https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk
og:image: https://api.daily.dev/og/posts/eWzNuhyhk.png
og:image:alt: Different ways to authenticate your APIs
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Different ways to authenticate your APIs

**[Hashnode](https://daily.dev/sources/hashnode)** · [@apoorvtyagi](https://daily.dev/apoorvtyagi) · 4 min read · 26 upvotes · 2 comments

## Summary

Using basic authentication for authenticating users is usually not recommended since sending the user credentials for every request is a bad practice. API keys are a way to authenticate an application accessing any API without referencing an actual user. OAuth specifies mechanisms where an application can ask a user for access to services on behalf of the user, and receive a token as proof.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://apoorvtyagi.tech/different-ways-to-authenticate-your-apis>

## Community discussion

Top comments from developers on daily.dev.

**@babs** · 4 upvotes

> I use JWT to secure my API especially in spring security

---

Tags: [#authentication](https://daily.dev/tags/authentication)

[View this post on daily.dev](https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Different ways to authenticate your APIs","url":"https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk"},"datePublished":"2020-10-02T05:21:51.161Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Using basic authentication for authenticating users is usually not recommended since sending the user credentials for every request is a bad practice. API keys...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cf9e7aae2501107e13e13016e969a919","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cf9e7aae2501107e13e13016e969a919","isAccessibleForFree":true,"articleSection":"Hashnode","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Apoorv Tyagi","url":"https://daily.dev/apoorvtyagi","image":"https://media.daily.dev/image/upload/f_auto/v1612676881/avatars/ADFht3JkC","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":700}},"commentCount":2,"discussionUrl":"https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":26},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"authentication","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hashnode","item":"https://daily.dev/sources/hashnode"},{"@type":"ListItem","position":3,"name":"Different ways to authenticate your APIs"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/different-ways-to-authenticate-your-apis-ewznuhyhk","comment":[{"@type":"Comment","text":"I use JWT to secure my API especially in spring security","datePublished":"2020-10-02T13:32:33.796Z","url":"https://daily.dev/posts/eWzNuhyhk#c-OA8GjDNkp","author":{"@type":"Person","name":"Babacar NDIAYE","url":"https://daily.dev/babs","image":"https://avatars3.githubusercontent.com/u/46944121?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}}]}
```

