azure-docs
azure-docs copied to clipboard
Restricting access to entire application does not work with navigationFallback
Relative section: https://learn.microsoft.com/en-us/azure/static-web-apps/configuration#restricting-access-to-entire-application
Suggestion:
You should specify that this does not work when the navigationFallback
section is configured as it overrides this behavior
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: ac225b59-6d75-1c98-3bd5-9483a818c8d4
- Version Independent ID: 40e9a5f6-4461-b926-427b-ee889b2c3754
- Content: Configure Azure Static Web Apps
- Content Source: articles/static-web-apps/configuration.md
- Service: static-web-apps
- GitHub Login: @craigshoemaker
- Microsoft Alias: cshoe
@Tiberriver256 Thanks for your feedback! We will investigate and update as appropriate.
@Tiberriver256 To test this behavior, we have configured the below routes in our staticwebapp.configuration,json
based on the repro we understood that authentication restrictions works even if we have enabled navigation feedback.
{
"routes": [
{
"route": "/*",
"allowedRoles": ["authenticated"]
}
],
"navigationFallback": { "rewrite": "/index.html" }
}
-
All the incoming requests which were authenticated and if we are searching for a particular file (like test.htmlor app.html) which is not present in your github repo then the request will execute the navigation fallback to index.html
-
If the request is un-authenticated then customer experience 401 access then the navigation fallback will get triggered.
Feel free to reach back to me if you have any further questions on this.
This issue has a better explanation that I think will help: https://github.com/Azure/static-web-apps/issues/670
You have to trip the navigationFallback rule to bypass your routes config.
@Tiberriver256 I'd been discussing on this internally, after our initial check, your feedback has been shared with the content author @craigshoemaker for further review and update the doc as appropriate
Thanks for your feedback and your contribution to Azure docs.
Feedback for this repository is moving away from GitHub to a system specific to the Microsoft Learn platform. Issues for this repository will soon be disabled, and additional comments from GitHub will no longer be possible. However, we are now tracking and triaging this issue in the new feedback system.
To learn more about our feedback systems, please see Provide feedback for Microsoft Learn content.
#please-close