YannickRe / spfx-msgraph-peoplesearch

Show and search users from your organization with an SPFx web part, through Microsoft Graph.
40 stars 33 forks source link

Being redirected to the SPFx redirect page: SPFx Single Sign On Redirect #82

Open StefanBreedveld opened 4 months ago

StefanBreedveld commented 4 months ago

Since a couple of weeks I am being redirected to the SPFx Single Sign On Redirect Page when trying to access a page where a peoplesearch webpart is set. The redirect page needs to refresh two times before users can read the page.

In the browser tabname the following title is shown -> SPFx Single Sign On Redirect Page.

I am automatically taken to this page: [https://mytenant.sharepoint.com/_forms/spfxsinglesignon.aspx#code=...........

I've tried this on 4 different browsers (normal and incognito modus) all resulting in the same issue.

YannickRe commented 4 months ago

Hi @StefanBreedveld

This has nothing to do with my web part, and is essentially the only way SPFx can workaround the issue of third party cookies being blocked by your web browser. @estruyf has written a good explanation about this: https://www.eliostruyf.com/browser-refreshing-sharepoint-page/

StefanBreedveld commented 4 months ago

Hi @YannickRe

Thanks for you explanation. I still have a question about the API settings in the SharePoint Admin Center. As referenced in the blog above (@estruyf). iIt describes 2 solutions to solve this problem. I approved the permission scope in the API access page in the SharePoint Admin Center, but the page keeps refreshing 2 times.

Is solution 1 (setting User.Read.All in API access settings) no longer sufficient and are both solutions necessary to prevent the refresh in the browser?

api_access

estruyf commented 4 months ago

@StefanBreedveld if you can try to intersept the redirect (via Fiddler, or any other proxy tool), you can see what permission scopes are requested. Might be a scope is missing.

StefanBreedveld commented 4 months ago

Thanks @estruyf - I have no experience with fiddler but I will look into this.

@YannickRe aren't there other people reporting this problem? This issue only occurs with the peoplesearch web part on all MS365 tenants where we deployed it. My feeling is that Microsoft has changed something in the background that is now causing this problem...

Thanks anyway for your help!

estruyf commented 4 months ago

@StefanBreedveld I've just verified the web part for you. Make sure you have the User.Read.All Microsoft Graph permission scope configured and admin consented on the SharePoint Online Client Extensibility Web Application Principal app registration in Microsoft Entra ID.

image