geoffsmith82 / GmailAuthSMTP

This project is a very basic demo showing how to authenticate with OAUTH2 and send an email message for gmail, microsoft/office365 as well as hotmail.com/outlook.com/live.com email addresses.
MIT License
110 stars 21 forks source link

Instructions for use with Office365 #3

Open david-navigator opened 4 years ago

david-navigator commented 4 years ago

I've created an application token in Office365 and added it to Globals.pas, but when trying to Authenticate my browser pops up with the message

We're unable to complete your request unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https://go.microsoft.com/fwlink/?linkid=2083908.

However that link simply takes me back to the page where I created my application token (displaying the application token), so I'm assuming I've missed a step.

Any suggestions what I should be looking for ?

andyhill2 commented 4 years ago

Geoff, can we get a sample Globals.pas file with dummy values so that we can modify and test - thanks in advance.

geoffsmith82 commented 4 years ago

I've added a globals.sample.pas file to the project with sample values to change.

david-navigator commented 4 years ago

Thanks, but no joy.

I noted that you have a const microsoft_clientsecret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';

but in the sample code, the secret isn't used

  AuthorizationEndpoint : 'https://login.live.com/oauth20_authorize.srf';
   AccessTokenEndpoint : 'https://login.live.com/oauth20_token.srf';
   ClientID : microsoft_clientid;
   ClientSecret : '';

So maybe the sample code isn't the most uptodate ?

But even adding the secret above doesn't solve my errors. I've been following these instructions to configure the Microsoft end - maybe there's something different required ? https://www.clevercomponents.com/articles/article049/