balls mcgee
Download a file in a new tab from a controller that requires auth
We want to allow our clients to download files into new tabs like images and PDFs. When we <a href="..." target=_blank ... the tab opens but doesn't have the necessary bearer token to download the file. We tried making it download a blob and then sending the user's browser there, but the url opens as a guid which makes saving the file a real pain because you don't know the original file name. It also doesn't seem to work in mobile.
We are thinking about maybe making secure tokens to allow a one-time non-auth download, but that seems like more work than it should be.
How can I open a file in a new tab that requires a bearer token?
5 replies
Detailed 401 errors SPA bearer token
I created a minimal example to replicate an issue I'm having with a SPA OIDC and a bearer token
I keep getting 401 from the following setup:
Very simple setup. I don't know what the issue is. I just need some debugging information.
I changed my appsettings.json
Nothing prints in the console, though, when I get a 401 from WeatherForecast. Any help would be greatly appreciated.
1082 replies
❔ Redirect all unauthenticated requests for an SPA to OAuth
I have an Angular SPA app. I don't want them to be able to load any of the assets on this server without a validated JWT token from IdentityServer. How can I redirect before anything is served?
4 replies
How to set connection strings for remote server
I'm uploading my project for the first time to another server accessible from the net.
I set my secret like
dotnet user-secrets set ConnectionStrings:YourDatabaseAlias ...
according to Microsoft's documentation, but I cannot find a single thing about how to set those secrets in my remote server.12 replies