Skip to main content

Sending e-mails using MS Modern Auth in Merit Palk

Updated over 6 months ago

Microsoft Modern Authentication in Merit Palk

If you have chosen „Exchange Modern Auth“ as your option for sending out e-mails from Merit Palk, you will see boxes that have to be filled with application information, created and provided by e-mail service provider:

Pilt, millel on kujutatud tekst, kuvatõmmis, tarkvara, Veebileht

Tehisintellekti genereeritud sisu ei pruugi olla õige.

To create suitable application, you need to enter Office365 portal with admin user, go to „Admin“->“Show all“->“all admin centers“->“Microsoft Entra“

Pilt, millel on kujutatud tekst, kuvatõmmis, number, tarkvara

After entering MS Entra you will find first ID we need to use in Merit Palk e-mail settings, „Tenant ID“:

Pilt, millel on kujutatud tekst, kuvatõmmis, tarkvara, Veebileht

Kirjeldus on genereeritud automaatselt

Next we need to create application that we will use to send out e-mails, we create rights for this application and secrets:

Pilt, millel on kujutatud tekst, kuvatõmmis, tarkvara, Arvutiikoon

Kirjeldus on genereeritud automaatselt

As you probably create application just for one domain, you should use „Single Tenant“ option:

After application is created, you have got next value for Merit Palk, „User/Application ID“ (number 1), Number 2 shows the place you can create value for a field „Client Password“ ja number 3 shows the place for creating rights for your application.

API rights:

Click API Permission -> Microsoft Graph -> Delegated Permission -> User.Read.

Click API Permission -> Microsoft Graph -> Application Permission -

> Mail.Send.

Click API Permission -> Add a permission -> APIs in my organization uses -

> Office 365 Exchange Online -> Application Permission -

> Other permission -> full_access_as_app

If an admin user used for setting up application is not current domain user, you cannot find „Office 365 Exchange Online“ in the list of rights and you have to add this manually.

Also we have to „Grant admin consent“ as 2 of our permissions need it:

Pilt, millel on kujutatud tekst

Kirjeldus on genereeritud automaatselt

Secret(s) can be created as shown above and you need to copy Value field to Merit Palk. You can create individual secret for every user that needs it, or just one for everyone. Sender will be the one, named on the Merit Palk field: „Exchange user“

After this is done, your „Exchange Modern Auth“ option should work.

Possible error messages:

If you have incorrect „Application ID“: „(400) Bad Request“

If you have incorrect „Tenant ID“: „is not avalid for TenantId“

Server name is incorrect: „(400) bad Request“

Wrong „secret“: „(401) Unauthorized“

Wrong „Exchange username“: „(500) Internal Server Error“

Did this answer your question?