xwikisas / application-office365

Office365 integration
2 stars 2 forks source link

"Failed to execute the [groovy] macro" error which prevents users to login with the application #19

Closed ilieandriuta closed 2 years ago

ilieandriuta commented 2 years ago

Environment: Windows 11 Pro 64bit, Firefox 98, using an instance of XWiki 14.1 on Tomcat 9.0.59/ PostgreSQL 14 (tested also on XWiki 13.10.3 Jetty/HSQLDB) on Java 11 and Java 17 from Oracle with Office365 Integration (Pro) 1.9.1

STEPS TO REPRODUCE

  1. Go to Administer Wiki > Other > Office365 and fill the Tenant name, Client ID and Secret Key corresponding to the application from Azure Portal
  2. Edit a page in wiki/source mode
  3. Insert {{office365 /}} macro
  4. Click Save & View

EXPECTED RESULTS

The user is asked to login to Microsoft365.

ACTUAL RESULTS

An error is displayed only in the browser and the user cannot login:

Failed to execute the [groovy] macro. Cause: [class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')]. Click on this message for details.

Full stacktrace is available here: https://up1.xwikisas.com/#78RiUGVIB0NujZBTyPy8Cg

The issue reproduced also on XWiki 13.10.3. However, I've tested with Office365 Integration (Pro) 1.8 and the issue could not be reproduced.

OfficeOAuth_Error

AndreeaChi commented 2 years ago

I have reproduced the issue on XWiki Cloud 12.10.6 as well with Office365 Integration 1.9.1 with slightly different steps:

  1. Install the Office365 Integration 1.9.1 version
  2. Register the app according to the installation documentation on the Azure portal
  3. Add the credentials on the XWiki Adminstration > Other > Office365
  4. Go to the page https://testandreealicenses.cloud.xwiki.com/xwiki/bin/view/Office365/OAuth and you should see a permissions message and agree with it: image

Result right after: image

AndreeaChi commented 2 years ago

The issue also reproduces when on a new browser session, I log into the wiki, then I access the https://testandreealicenses.cloud.xwiki.com/xwiki/bin/view/Office365/OAuth .

It asks to sign in with the Microsoft account, I add the credentials of my Microsoft account and right after the result is the same error.