[Documentation] I need some detail description on how to configure OAuth2/JWT in SWA Database connections
What happened?
I configure AzureAD as authentication provider, and also have audience and issuer for the jwt section, but I didn't manage to make it work. does anyone could help or provide a detail document on how to set it up by using AzureAD to authenticate the data-api. thanks a lot.
Version
1.1.7
What database are you using?
Azure SQL
What hosting model are you using?
Static Web Apps (SWA)
Which API approach are you accessing DAB through?
REST
Relevant log output
{
"error": {
"code": "AuthorizationCheckFailed",
"message": "Authorization Failure: Access Not Allowed.",
"status": 403
}
}
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hi @lgc019, When using SWA Database Connections, you must use "StaticWebApps" as the authentication provider. You can configuration Azure AD / EntraID auth by following this Static Web Apps doc: https://learn.microsoft.com/azure/static-web-apps/authentication-custom?tabs=aad%2Cinvitations
@seantleonard thanks a lot for your comment. I managed to configure AzureAD with jwt on Azure Container App, it is working fine. But the same configuration is not working on SWA.
That is by design that when using SWA Database Connections, the only provider that is supported is StaticWebApps. That's because Static Web Apps handles authentication upstream of DAB.
I've updated the title and will add an action to our backlog to improve the DAB documentation to make it clearer which providers are supported in which hosting model.
@seantleonard thanks a lot for your comment. I managed to configure AzureAD with jwt on Azure Container App, it is working fine. But the same configuration is not working on SWA.
If you are interested in writing a blog article on configuring AzureAD wit JWT on Azure Container Apps, let me know, I would love to help you with it and get it promoted.
Closing. If you are using Static Web Apps, your Auth provider must be StaticWebApps.