We require architectural advice for our setup.
We are developing a mobile application which will:
- Use B2C Authentication
- Support anonymous users (allowing users to skip the registration process)
- Still perform a form of Authentication on API requests by using Azure access tokens (if possible)
What we have attempted to implement:
Anonymous client - When a user opts to skip the registration process:
- Trigger a silent sign-up request to B2C via MS Graph
- Populate a custom field with a backend-generated
deviceID, which we could later use to recognize the user. - Generate token with the information above
The user would not have an impression of being registered and no personal data would be collected.
(Completely) Registered client - If the user decides to complete the registration,
- Start the regular B2C interactive sign-up process and ask the user to enter all required info.
- In the background, check if the user exists by sending the previously generated
deviceIdto B2C and comparing it with the user's entered info.- If the user DOES exist
- Skip some of the further sign-up steps
- Perform a silent profile update via Graph using our API with the
deviceIDand user's data.
- If the user DOES NOT exist (User was completing the sign-up for the first time, after installing the app)
- Proceed with the normal sign-up flow
- If the user DOES exist
This seemed like something which could be achieved using custom policies and using the id_token_hint which would contain the deviceId and be sent in an inbound JWT from our API to the B2C. In the policy, we would add an extra orchestration step to the user journey for extracting the deviceId and passing it on to be used in the validation orchestration step.
However, this seems far too complicated and so far we had no success in making this work. Therefore, we would kindly ask for your advice on the matter.
Is there an out-of-the-box solution which covers this sort of scenario?
Some feature which would support the concept of 'temporary application users'.
If not, what would be the correct outline of steps needed to make this work?