I'm having some difficulties with AD authentication, I log the user in using the angular MSAL library and send the bearer token to the backend.
Backend handles it perfectly and stores the userclaim. What happens though is that the groups the user is part of in AD are not in this claim. This is because there are too many groups in AD and Azure just returns "hasgroups : true". This is fine and I just retrieve the user groups using the Graph API.
Only now I'm wondering, how do I add the retrieved groups to the existing user claim? My end goal is that I can authorize certain groups to controllers using the following code:
[Authorize(Roles = "EmployeeOnly")]