0
votes

We have developed a windows application to upload/download file on a OneDrive account using LiveSDK.

As new requirement now we need to support OneDrive for Business also.

Url for access token for LiveSDK : https://login.live.com/oauth20_authorize.srf?client_id={client_id}&scope=wl.signin%20wl.offline_access%20onedrive.readwrite&response_type=token&redirect_uri=https://login.live.com/oauth20_desktop.srf

As switching to code flow for using OneDrive for Business we are using

https://login.microsoftonline.com/common/oauth2/authorize?response_type=code&client_id={client_id}&redirect_uri=https://login.live.com/oauth20_desktop.srf

Can anyone please help with redirect_uri to be used here? Application is been registered in azure portal.Following the steps in this MS blog post

[https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/aad-oauth?view=odsp-graph-online#register-your-app-with-azure-active-directory]

2

2 Answers

0
votes

I think what you are talking about should be the auth code flow of Azure AD. Your redirect_uri does not seem to be a problem, you only need to add it to the application.

enter image description here

0
votes

Here is what I'm using.

URI_PERSONAL_ACCOUNT        = "https://login.live.com/oauth20_desktop.srf"

URI_BUSINESS_ACCOUNT    = "https://login.microsoftonline.com/common/oauth2/v2.0/"

enter image description here