Reputation: 177
I have been testing the new Azure Static Web Apps, but have been unable to find out how I can secure for ex. an index.html file with Azure AD SSO. I know I can send invites, but how can I ensure the site can only be loaded by "all users" or "some groups" within my AD?
Thanks
Upvotes: 0
Views: 611
Reputation: 246
You can do this using an external OIDC enabled IDaaS like Okta or Auth0
Make sure you define routes in a routes.json
file for SPAs otherwise SWA will not know what to do with these.
Now when anyone attempts to access the app, they will be redirected to an MSFT login screen for your AD tenant, and receive a code
, token
or id_token
depending upon the flow and response_type
you defined in your app
Upvotes: 0
Reputation: 299
I don't believe Azure Static Web Apps currently supports Azure AD SSO. Azure Static Web Apps is still in preview. If you would like to request this as a feature please leave your feedback here.
In the meantime, you can try using routing in Azure Static Web Apps to customize rules and authorization behavior for both static content and APIs.The rules are defined as an array of rules in the routes.json file.
Based on the Documentation: "Routes are secured by adding one or more role names into a rule's allowedRoles array. See the example route file for usage examples.
By default, every user belongs to the built-in anonymous
role, and all logged-in users are members of the authenticated
role. For instance, to restrict a route to only authenticated
users, add the built-in authenticated
role to the allowedRoles
array."
Upvotes: 1