TppRESTMailOutlook365 Using without a Report
Hi,
Will this still work after 22nd October when connecting to a Microsoft email server?
If so, how do I retrieve and set the token?
If not, what should I use?
Thanks,
Ken
Will this still work after 22nd October when connecting to a Microsoft email server?
If so, how do I retrieve and set the token?
If not, what should I use?
Thanks,
Ken
Comments
I am not aware of any major changes to the way Microsoft handles OAuth2 verification in the near future. Is there something I am missing?
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Do you have a link to this information?
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
So back to my other question, how can the token be accessed?
ReportBuilder fully supports REST API access to Gmail and Outlook.com using their OAuth2 authentication process. Once you register your application with the mail service, ReportBuilder handles the retrieval of the access token internally and then sends the email.
See the following articles on web mail overview with RB and background on the OAuth2 protocol.
https://rbwiki.digital-metaphors.com/output/email/web-mail-overview/
https://rbwiki.digital-metaphors.com/output/cloud-drive/oauth2-overview/
Then see the following articles on how to register your app and send emails using these plugins.
https://rbwiki.digital-metaphors.com/output/email/web-mail-setup-outlook-com/
https://rbwiki.digital-metaphors.com/output/email/web-mail-setup-gmail/
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
{"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter:
''code''.\r\nTrace ID: a7eacbf8-2b08-420d-8835-8556bbe35500\r\nCorrelation ID: 22936f2d-49de-4d48-9feb-a50f2ea3039e\r\nTimestamp: 2022-09-23 08:03:33Z","error_codes":[900144],"timestamp":"2022-09-23 08:03:33Z","trace_id":"a7eacbf8-2b08-420d-8835-8556bbe35500","correlation_id":"22936f2d-49de-4d48-9feb-a50f2ea3039e","error_uri":"https://login.microsoftonline.com/error?code=900144"}
In my testing with new credentials, the plugin is working correctly. I went ahead and created a new app registration to see if anything has changed.
1. It appears the authentication code is not being received. Be sure you select "Web" application during the registration process. (This is a new setting so I will update our articles).
2. Be sure you set the ClientID and ClientSecret correctly. Also be sure you defined the proper Redirect URI in your app registration and report property. This should be "http://localhost".
3. During your app registration, be sure you gave your application proper permissions to access outside accounts. (i.e. "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts").
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
That now works ok except it then opens an Outlook web page with the details of the email saying [Draft] This message hasn't been sent.
Thanks,
Ken
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Note that access tokens are generally only valid for 1 hour.
It is on our list of possible enhancements to handle this internally as well as provide refresh token support for a later release of ReportBuilder
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Hi,
May I know what is causing this ?
I copy exactly the same code, but it is unable to send email, and in the debug mode getting this error
thank you