Check if logged in user is O365 user

Created on 27 April 2023, about 1 year ago
Updated 25 September 2023, 9 months ago

If we add the block on a page layout and the logged-in user is not a O365 user we get a redirect screen.
We dont want this, we want to see the placeholder for people who are not O365 users.

✨ Feature request
Status

Fixed

Version

5.0

Component

Code

Created by

🇧🇪Belgium ghuygens

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ghuygens
  • Status changed to Postponed: needs info about 1 year ago
  • 🇳🇱Netherlands fabianderijk Alphen aan den Rijn

    Can you explain exactly what you are doing? Whenever I place (for example) the latest mail, and upcoming appointments block to the sidebar as a user logged in via o365 I see the blocks and contents. When I log in as a non o365 user everything still works, and I don't get redirected.

  • Status changed to Needs review about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    We are using the dashboards module to place some o365 blocks on the dashboard.

    For example it's impossible to as an admin (none o365 user in this case, but a keycloak user) to configure the dashboard. When trying to place any of the o365 blocks, we get a fatal exception thrown, stopping the block from being placed. The issue here is probably that the dashboard/layout builder already tries to render the block, which obviously doesn't work.

    Microsoft\Graph\Exception\GraphException: No access token has been provided. in Microsoft\Graph\Http\GraphRequest->__construct() (line 136 of /var/app/vendor/microsoft/microsoft-graph/src/Http/GraphRequest.php).
    

    This patch solves that issue, allowing admins to configure dashboards, and to have the common dashboard with those o365 blocks not crashing on them.

  • Status changed to RTBC about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Actually RTBC since I verified the fix in one of our projects where @ghuygens applied the patch.

  • Status changed to Needs work about 1 year ago
  • 🇳🇱Netherlands fabianderijk Alphen aan den Rijn

    I've just tried to apply the patch so I can check, but this fails:

    Checking patch modules/o365_outlook_calendar/src/Plugin/Block/CalendarBlock.php...
    Checking patch o365.services.yml...
    Checking patch src/AuthenticationService.php...
    Checking patch src/GraphService.php...
    error: while searching for:
       * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException|\GuzzleHttp\Exception\GuzzleException
       */
      public function getGraphData($endpoint, $type = 'GET', $raw = FALSE, $version = FALSE, $returnType = FALSE) {
        return $this->getData($endpoint, $type, $raw, $version, [], $returnType);
      }
    
    
    error: patch failed: src/GraphService.php:82
    error: src/GraphService.php: patch does not apply

    Could you check the patch on the latest 3.0 dev version?

  • @bramdriesen opened merge request.
  • Status changed to Needs review about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪
  • Issue was unassigned.
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪
  • Status changed to Needs work about 1 year ago
  • 🇳🇱Netherlands fabianderijk Alphen aan den Rijn

    When already logged in, everything works fine, both as a user from office or a local user. However, when I try to log in using Office some things are broken. Anonymous users aren't redirected to Office anymore.

    I've created a patch for your MR. Could you check if everything works for you when you apply the patch and update the MR?

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    I don't see any issue with the additions you've added :)

  • Status changed to Needs review about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪
  • 🇳🇱Netherlands fabianderijk Alphen aan den Rijn
  • Status changed to Fixed 9 months ago
  • 🇳🇱Netherlands fabianderijk Alphen aan den Rijn

    This is now fixed in the 5.0.x branch. And will be added to the new tagged release coming soon.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024