O365 Email transferred to the cloud - Authentication issues

Hi. We have transferred the mail exchange to the cloud. I use the ‘ApplicationIdAndSecret’ as Authentication Type, and are providing the Application ID, Application Secret and Tenant. When using old script with the Dependencies = ‘Windows - Legacy’ I am able to send e-mail and create list of e-mails in ‘Inbox’.

But when I create new scripts where the Dependencies = ‘Windows’ I only receive errormessage: “The provided value for scope Mail.Read Mail.ReadWrite Mail.Send Mail.ReadWrite.Shared User.Read - is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identified (application id url)”

Both types of scripts try to access a Shared mailbox.

Anyone that can help on what to do to fix this?

Hi @frode.veiseth

Yes, this happens with certain version of graph api package.

which version of O365 package you are using? This issue occurs with certain version of packages.

I would suggest using below version, it will work.

image

Hi. Thank you.
Yes, I use the 2.5.9 version

Frode

@frode.veiseth

My bad, unaffected version is 2.3.3

Please refer below post

if still doesn’t resolve for you, refer below post

Hi @frode.veiseth

Try might be work- for authentication type applicationidandsecret, set scope to https://graph.microsoft.com/.default only. do not list scopes like mail.read or mail.send. this is required for client credentials flow. update the microsoft 365 scope activity accordingly.

Happy Automation

Hi
Thank you for your help.
When I use the version 2.3.3 of the ‘Microsoft 365’ package and put the ‘Save Attachment’ in a ‘Microsoft Office 365 Scope’ it works as before.

1 Like

Hi @frode.veiseth

Happy to know it worked.

Kindly mark the post as solution so this topic can be closed and help others with similar issues.

Regards
Sonali

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.