I am a Dotnet developer student, and have been working on fullstack hobby project over the summer. The frontend is a Blazor Webassembly Standalone, and to access the backend I have ASP.NET CORE application using .NET8. For authentication I am using Identity with cookie authentication.
Everything works fine when run locally, and for the most part when hosted and run through Azure, except for one thing: getting the browser to store the cookies.
The front end is hosted with a Azure Static Web app, and the backend with an Azure Web app. When trying to sign in using postman, the postman “browser” receives the cookie and I can then access my protected endpoints from there. However, when I try to access the cookie from my front end client it just doesnt work.
The source code can be found here: https://github.com/josephRashidMaalouf/OpersonligtBrev
I have not been able to find any information about this issue, and to be honest I am not entirely sure where the problem lies. Has anyone experienced this before? I am grateful for any clue that might help me solve this issue.
I have tried this:
-
Run the front end locally and the backend from azure: I receive the cookie, but it is immediatly discarded. See picture 1. The cookie is also yellow for some reason.
Picture 1 -
Run the front end locally, and the backend locally: Everything works as expected.
-
Run the front end and back end from azure: I dont even get the yellow cookie.
-
Authenticate with a postman client to the azure hosted api: works as expected.
Joseph Rashid-Maalouf is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.