0
votes

I am currently using EWS in my application to access Exchange data. I want to add functionality for Office365 using rest api.

With EWS, Authorization was quite simple, just add Authorization tag in header with username and password base64 encoded, I bealive it is called basic Authorization.

But with office 365 the process gets 2 extra stepsenter image description here

On the image above you see that 2 steps are in between my application and office365.

Every office account that will use my application, must do some configuration steps at Microsoft azure. to get secret key, client it and tenant id.

I would like to avoid that, ideally user needs only to enter his credentials thus I can access all of his data in office 365 programmatically.

1

1 Answers

1
votes

Every office account that will use my application, must do some configuration steps at Microsoft azure. to get secret key, client it and tenant id.

If I understand your question correctly, you want to avoid all the steps to configure the client_id, secret key for your app user?

  • If your app is a browser-based web app, the "Application" block on your diagram actually consists of web server and user/browser. In this case, only the web server needs to pull the configurations from the Azure, client_id, secrect, etc... This being said, the user/web browser only needs to enter his credential, and with implicit consent, you app will have access the the user's data. Such workflow can be described below, enter image description here

In this case, you app user/browser does not need to pull the configurations from Azure. Only the web server does.

  • If your app is a native app, when you make a request to the auth endpoint, you app needs to include the client_id and redirect URI in the request. This is shown on the first step below. enter image description here

In this case, your app user can use the same client_id and redirect URI, you don't need to "force" them to create their own's, so that they only need to input their username and password.

You can find more info on Azure AD authentication from https://azure.microsoft.com/en-us/documentation/articles/active-directory-authentication-scenarios/