Inbound E-Mail using Exchange Online and Client Credential Flow

Tobias Schlatte
Mega Expert

I am trying to set up account for a bunch of inbound mailboxes running on Exchange Online.

 

I find instructions on how to set it up using a OAuth Autorisation Code flow but none on how to set it up with Client Credential flow.

 

Is this even possible?

1 ACCEPTED SOLUTION

Tobias Schlatte
Mega Expert

I will resolve my own question. I found the solution in the ServiceNow Docs. Using CC flow with MS Graph is absolutely possible. Just follow the steps described here:

https://www.servicenow.com/docs/r/platform-administration/read-email-using-ms-graph.html

 

This is running on our production instance without any issues.

View solution in original post

2 REPLIES 2

Prathmeshda
Giga Guru

hello @Tobias Schlatte 
No — you cannot set up ServiceNow inbound email from Exchange Online using the OAuth 2.0 Client Credentials grant flow by itself. ServiceNow’s inbound email system expects a user context (delegated OAuth) or a user/password (traditional IMAP/POP3) connection. Client Credentials flow is not supported for inbound mailbox access in ServiceNow.

Why:
ServiceNow’s inbound email reader needs to log into an email server (IMAP or POP) to read mails on behalf of a mailbox. That requires either:

Delegated OAuth tokens (i.e., a user must authenticate interactively once and ServiceNow refreshes tokens), OR

Traditional credentials (username/password).
Client Credentials (app‑only) tokens don’t associate with a real user mailbox in the way ServiceNow’s inbound mail processor expects.


|If this response proves useful, please mark it as Accept as Solution and Helpful. Doing so benefits both the community and me. 👍🙂

Tobias Schlatte
Mega Expert

I will resolve my own question. I found the solution in the ServiceNow Docs. Using CC flow with MS Graph is absolutely possible. Just follow the steps described here:

https://www.servicenow.com/docs/r/platform-administration/read-email-using-ms-graph.html

 

This is running on our production instance without any issues.