Auditing SQL tables when using Azure AD

南笙酒味 提交于 2020-06-29 04:25:12

问题


In our SQL tables we have columns such as UpdatedBy and CreatedBy with a ref key to a User table. This is useful to keep track of who created/updated an business entity.

However we are migrating from this local User table to using Azure AD. We will use Azure AD for authentication and authorization in our client applications.

There should be no need for a local User table (or any other tables related to identity, such as Role etc...), but then how do I reference user ids from Azure AD into my audit columns? Obviously I can no longer have a reference key with constraint.

What is the usual approach to this?


回答1:


Did you read about System for Cross-Domain Identity Management (SCIM)? You can provide out of the box mechanism for syncing Users and Groups created in the Azure AD.

There is a whole tutorial about how to do that:
https://docs.microsoft.com/en-gb/azure/active-directory/app-provisioning/use-scim-to-provision-users-and-groups#step-4-integrate-your-scim-endpoint-with-the-azure-ad-scim-client

There is a ready to go CRUD and SCIM based application in C# created by Microsoft https://github.com/AzureAD/SCIMReferenceCode

That will give you a solution what to do for example when Azure AD is removing the user, but you want to keep it.



来源:https://stackoverflow.com/questions/62290473/auditing-sql-tables-when-using-azure-ad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!