I have an ASP.NET Core 3.1 API backend which is already configured to allow CORS for my web app -- see below.
I'm now building a mobile app in React Native. How do I add the specific origin for my React Native app so that my API accepts requests from my mobile app?
I don't want to allow everyone and any app. I do want to keep it as secure as possible and specify my web and mobile apps.
Here's what's currently in my Startup.cs:
services.AddCors(action =>
action.AddPolicy("AllowSpecificOrigin", builder =>
builder
.AllowAnyMethod()
.AllowAnyHeader()
.WithOrigins("https://mywebapp.com", "http://localhost:50920", "https://myaccount.service.signalr.net", "http://localhost:3000")
.AllowCredentials()));