sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

How to avoid multiple 'extra credentials' errors on page

Open justdevelopment opened this issue 7 years ago • 5 comments

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

In some scenario's users get the error message that there is something wrong with their credentials and they have to 'click here' to fix it. This usually does fix the issue, but this error message gets re-added for every call we do via the graph client. This can add up to quite a few messages if you have a full intranet homepage with a bunch of SPFx components.

Is there some way we can verify the user is correctly logged in before we start doing calls? I can't find anything in the docs for the MSGraphClient regarding this. Right now we use this: (docs; https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph)

this.context.msGraphClientFactory
               .getClient()
               .then((client: MSGraphClient): void => {
   	// do stuff here with our client
   	// any client.get() done here will add an error message to the page
   },
   error => {
   	// handle errors, this doesn't go off ever
   }
);

Observed Behavior

A whole bunch of errors (Dutch, sorry) get added when doing MSGraphClient calls and there is something wrong with the current user token/login

image

I've been told this happens mostly when switching networks or when switching accounts isn't done properly. The error is correct and it's fine that it shows, but once is enough ;)

Perhaps it is also possible to add to the SPFx SSO backlog that the errormessage only gets shown once on the page?

justdevelopment avatar Nov 18 '19 16:11 justdevelopment

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msft-github-bot avatar Nov 18 '19 16:11 msft-github-bot

No-one has a clue how to prevent this?

Should I update this ticket to be a bug then? It doesn't seem quite right to have this many errors. It's also very noticeable to Safari users as that browser tends to have a lot of issues with SPFx SSO.

justdevelopment avatar Dec 04 '19 08:12 justdevelopment

I get this issue some times too but it seems more like a general issue in SharePoint. I was not able to fix it now.

StfBauer avatar Dec 19 '19 15:12 StfBauer

This has been fixed, we now only see one error.

justdevelopment avatar Jun 03 '20 14:06 justdevelopment

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jun 10 '20 18:06 msft-github-bot