Example #1
0
 /**
  * Handles logins from the OpenID Connect auth plugin.
  *
  * Does the following:
  *     - Uses the received OIDC auth code to get tokens for the other resources we use: onedrive, sharepoint, outlook.
  *
  * @param \auth_oidc\event\user_loggedin $event The triggered event.
  * @return bool Success/Failure.
  */
 public static function handle_oidc_user_loggedin(\auth_oidc\event\user_loggedin $event)
 {
     if (\local_o365\utils::is_configured() !== true) {
         return false;
     }
     // Get additional tokens for the user.
     $eventdata = $event->get_data();
     if (!empty($eventdata['other']['username']) && !empty($eventdata['userid'])) {
         static::get_additional_user_info($eventdata['userid'], 'login');
     }
     return true;
 }
Example #2
0
 /**
  * Handles logins from the OpenID Connect auth plugin.
  *
  * Does the following:
  *     - Uses the received OIDC auth code to get tokens for the other resources we use: onedrive, sharepoint, outlook.
  *
  * @param \auth_oidc\event\user_loggedin $event The triggered event.
  * @return bool Success/Failure.
  */
 public static function handle_oidc_user_loggedin(\auth_oidc\event\user_loggedin $event)
 {
     // Get additional tokens for the user.
     $eventdata = $event->get_data();
     if (!empty($eventdata['other']['username']) && !empty($eventdata['userid'])) {
         static::get_additional_user_info($eventdata['userid']);
     }
     return true;
 }