Some users get a 50058 error when attempting to connect to the Graph API. It is not happening to everyone, so I'm at somewhat of a loss what the problem could be. From what I can tell is that it is related to pulling a list of groups.

The code is using the php-sdk to connect to version 1 of the API. I am currently pulling groups through the createCollectionRequest in order to get all the pages. This works fine for most users, but a few have the problem above. The only difference I can find is that they are using ADFS. Could this be causing the problem? If I change the createCollectionRequest to a basic createRequest it works fine, but obviously, I lose the pagination and it no longer gets all the groups.

The old code causing the problem:

$grabber = $this->graph->createCollectionRequest("GET", '/groups')
    ->setReturnType(Model\Group::class)
    ->setPageSize(100);

    $results = array();
    while (!$grabber->isEnd()) {
        $results = array_merge($results, $grabber->getPage());
    }

The new code that is working, but limits group pull:

$results = $this->graph->createRequest("GET", "/groups")
    ->setReturnType(Model\Group::class)
    ->execute();

This is the error the users are getting:

Status 
Interrupted 
Sign-in error code 
50058 
Failure reason 
The application tried to perform a silent sign in and the user could not be silently signed in. The application needs to start an interactive flow giving users an option to sign in. Contact app owner. 
Client App 
Browser

0 Answers