clearContent(); $MIOLO->getClass('gnuteca3', 'azure/GAzure'); $MIOLO->getClass('gnuteca3', 'azure/Graph'); $busAuthenticate = $MIOLO->getBusiness('gnuteca3', 'BusAuthenticate'); $busPerson = $MIOLO->getBusiness('gnuteca3', 'BusPerson'); $azure = new GAzure(); $urlRedirect = html_entity_decode($MIOLO->getActionURL('gnuteca3', 'azure')); $usuario = $azure->getDataAndTokens(MIOLO::_REQUEST('code'), $urlRedirect); if ( isset($usuario->data->preferred_username) ) { GAzure::log('Login executado com sucesso para usuário'); $person = $busPerson->getPersonByEmail($usuario->data->preferred_username); GAzure::log("Login executado com sucesso para usuário '" . $person[1] . "'"); // Define o usuário como autenticado. $busAuthenticate->createSession($person[0], $person[1]); } $MIOLO->page->redirect("index.php?module=gnuteca3&action=main:search:simpleSearch&formContentId=1&formContentTypeId=1"); ?>