Hi @Pablo Glomby · Thank you for reaching out.
The Application Registration has to be done only once for a given application that you are developing. Every user who is accessing your application don't need to do app registration or have a separate app registration instance. Authentication request includes the App ID of the registered application in the client_id parameter which is facilitated by MSAL.net.
If the users will be using their personal Microsoft accounts (like outlook.com, hotmail.com etc.) to sign into the application, all you need to make sure is, you have registered the application using the option "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)".
To automate app registration, you can use below Graph calls. If you create app registration via portal, it creates both application and servicePrincipal as one step. However, if you are using graph api for this purpose, you need to create application and servicePrincipal separately. While registering the application using this method, you need to make sure the signInAudience is AzureADandPersonalMicrosoftAccount to allow users to sign in with their personal Microsoft accounts.
- Create application: https://learn.microsoft.com/en-us/graph/api/application-post-applications?view=graph-rest-1.0&tabs=csharp
- Create servicePrincipal: https://learn.microsoft.com/en-us/graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0&tabs=csharp
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.