I am using Blazor IDE, developed an app that uses a Postgres DB in Azure and ASPNET security.
After publishing the app to an Azure App Service, the authentication doesn't work correctly.
- I can login using the 'hardcoded' tenantsadmin account.
- Using that account, I can view/create existing user accounts.
I cannot however:
- Log in with the other accounts
- Create a user account with a role linked to it (the account gets created, but the user-role failed with a 400 error)
Any suggestions for the above please?
Check your Azure application logs for errors.
Thank you for the suggestion -- I tried creating a new account and selected a role from the drop down to get this:
That said, I still cannot log in with other accounts (that I can log into when running the code locally, connecting to the same Postgres db instance where the ASPNET users are found).
Obviously you do not have any roles or users in your database. Check what database is using your published app - you cannot use the local database on your computer.
I do have roles and users in my DB. I am developing locally, against the same Azure Postgres DB.
That said, I did find the issue -- it related to the ASPNET tenant configuration in the DB which was not updated to reflect the Azure URL.
The ASPNET roles are linked to the ASPNET tenant and the code logic was unable to find the role for the tenant because the tenant id could not be determined (because of this URL issue)