staticwebdev / roles-function

https://docs.microsoft.com/azure/static-web-apps/assign-roles-microsoft-graph
8 stars 11 forks source link

GetRoles-app not working for users with 100+ AD groups #3

Open viggotw opened 2 years ago

viggotw commented 2 years ago

Hi!

We are using this solution for our template repo, and we have noticed some trouble with the role assignment. From within the same AD group, most users receive the custom role we defined, but a few don't. I believe the problem is caused by there being a max limit of 100 objects being returned when calling the graph-API. After that, you have to use paging.

By playing around in the graph-explorer, I tried modifying the JS-code by instead calling const url = new URL(`https://graph.microsoft.com/v1.0/me/memberOf/${groupId}`);, hoping that the API would only return the relevant object. This worked in the graph-explorer, but did unfortunately not solve the issue for my users.

chris-dnv commented 2 years ago

Hi Viggo did you ever get this to work? We seem to have the same issue with some users with groups over 100.

viggotw commented 2 years ago

Hi Viggo did you ever get this to work? We seem to have the same issue with some users with groups over 100.

Unfortunately not. We have been in contact with Microsoft and they told us they would look into it. But haven't heard anything in about a week.

viggotw commented 2 years ago

@chris-dnv: We have implemented a temporary fix in our own, public repo that might be of interest: https://github.com/equinor/az-static-web-app-docs-template/issues/36

chris-dnv commented 2 years ago

@chris-dnv: We have implemented a temporary fix in our own, public repo that might be of interest: equinor/az-static-web-app-docs-template#36 @viggotw thank you very much i will try this out, I didn't get anywhere with my own Microsoft support request unfortunately, do you know if Microsoft are working on a permanent fix at all?

viggotw commented 2 years ago

@viggotw thank you very much i will try this out, I didn't get anywhere with my own Microsoft support request unfortunately, do you know if Microsoft are working on a permanent fix at all?

No, sorry - I haven't heard anything about this.