---
title: "Secure your Yarp BFF with cookie-based authentication"
url: https://daily.dev/posts/secure-your-yarp-bff-with-cookie-based-authentication-nqasw1mqf
source_url: https://timdeschryver.dev/blog/secure-your-yarp-bff-with-cookie-based-authentication
type: article
source: "Tim Deschryver"
author: "Tim Deschryver"
published: 2026-05-31T07:47:29.273Z
updated: 2026-06-01T04:00:53.165Z
tags: ["authentication"]
reading_time: 8
upvotes: 0
comments: 0
language: 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.

# Secure your Yarp BFF with cookie-based authentication

**[Tim Deschryver](https://daily.dev/sources/timdeschryver)** · [@timdeschryver](https://daily.dev/timdeschryver) · 8 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to implementing cookie-based authentication in a YARP reverse proxy acting as a Backend for Frontend (BFF) within a .NET Aspire solution. Covers why cookies are more secure than JWT tokens (server-side session storage, HTTP-only, SameSite, HTTPS-only flags), how to configure ASP.NET Core cookie and OpenID Connect authentication schemes with Auth0, and how to create login, logout, and user-info endpoints for the frontend to consume.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://timdeschryver.dev/blog/secure-your-yarp-bff-with-cookie-based-authentication>

## Similar posts on daily.dev

- [What's the best way to do authentication in modern applications](https://daily.dev/posts/what-s-the-best-way-to-do-authentication-in-modern-applications-7iho9es5q) · Neciu Dan · 25 upvotes · 1 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/secure-your-yarp-bff-with-cookie-based-authentication-nqasw1mqf)
