question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Static Web App with Blazor and AUTH config in staticwebapp.config.json without effect on SWA CLI

See original GitHub issue

Describe the bug Thanks for all the work on this very nice tool! I like it a lot. But i experience a bug i guess. By starting SWA using this command: swa start https://localhost:5001 --api Api --swa-config-location ./Client/wwwroot , and f or sure previously startet dotnet run watch to have the server runniing. My expactation would be: AUTH can be simulated.

To Reproduce

  • use default Blazor SWA Demo repo

  • configure route in staticwebapp.config.json and place it in ./Client/wwwroot like so: `{

    “navigationFallback”: { “rewrite”: “index.html”, “exclude”: [“/_framework/", "/css/”, “*.{js,map,css,png,ico}”] },
    “routes”: [

    {
      "route":"/login",
      "redirect":"/.auth/login/aad"
    },
    {
      "route":"/fetchdata",
      "allowedRoles":["authenticated"]
    },
    {
      "route": "/.auth/login/twitter",
      "statusCode": "404"
    }
    

    ] }`

  • start dotnet run watch on the client path

  • start SWA CLI using this command: swa start https://localhost:5001 --api Api --swa-config-location ./Client/wwwroot

  • Navigate to “Fetch Data”

Expected behavior

  • Expected result: page cannot be loaded, cause u r not loged in. but it loads.

Desktop (please complete the following information):

  • Windows 10
  • Chrome
  • CLI 0.4.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
anthonychucommented, May 31, 2021

Tested the changes in #208 and it looks like this will be resolved by that PR! 🎉

2reactions
craigshoemakercommented, May 28, 2021

I updated the note at the top of the page to read:

The Azure Static Web Apps CLI is currently a preview feature and doesn’t read configuration defined in the staticwebapp.config.json file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Azure Static Web Apps - Microsoft Learn
Use staticwebapp.config.json as described in this article to configure routing and other settings for your static web app. This document is ...
Read more >
Securing an Azure Static Web App with Auth0 Actions
You can control aspects of the Azure SWA via a JSON configuration file named staticwebapp.config.json. I like to create this file at the...
Read more >
Static Web App CLI | SpringerLink
We've used the Azure Static Web App CLI (SWA CLI) in an earlier chapter to get started ... property of the “staticwebapp.config.json” file....
Read more >
#04: Configuring SWA | Azure Static Web Apps
When we think of configuring the Static Web App, we have three potential targets we can customize: Application: Use the staticwebapp.config.json ...
Read more >
Recently Active 'azure-static-web-app' Questions
I saw there is a env setting "skip_deploy_on_missing_secrets' but after setting that in ... Blazor web assembly website not working in Azure Static...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found