According to Microsoft Docs:
"The Anonymous Users Role is intended to be used with Entity Permissions. It will not respect any other rules or permissions. By enabling the "Anonymous Users Role" it will become the default web role for all users." - https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/create-web-roles
I configured Site Settings to enable WebAPI on the Contact entity, and on the firstname and lastname fields. I also configured an Entity Permission to allow update of the Contact entity, and assigned the EP to the default 'Anonymous Users' role (Anonymous Users Role field = Yes). I am making a WebAPI call on my portal to set the Firstname and Lastname fields of the current Contact when they first land on the Profile page after registering. The call fails returning a 403 (Forbidden) error:
error: {code: "90040102", message: "You don’t have permission to update contact entity."}
If I go into D365, and assign the Contact the 'Anonymous Users' Role, then the WebAPI call is successful and the firstname and lastname fields are updated. Considering that it works when the Contact is assigned the 'Anonymous Users' web role, it makes me think I have configured the Entity Permissions correctly and that the Contact after registration isn't gaining the Anonymous Users role.
Does anyone have any idea why the Contact after registration doesn't have the 'Anonymous Users' role applied? Thanks.