Incorrect redirect URL address while working with Microsoft Graph API

守給你的承諾、 提交于 2019-12-11 04:05:01

问题


I am working on Microsoft graph API for implementing the Email functionality.

  • The source code is referred from the official microsoftgraph github account.
  • I am following the step mentioned here
  • On this Step I supposed to get a code in redirect URL address.

I suppose to get below url as mentioned in the steps.

https://login.microsoftonline.com/common/oauth2/nativeclient?code={IAQABAAIAAABHh4kmS_aKT5XrjzxRAtHz5S...p7OoAFPmGPqIq-1_bMCAA}&session_state=dd64ce71-4424-494b-8818-be9a99ca0798

instead of that I am getting below url

https://login.microsoftonline.com/a1f1e214-xxxx-xxxx-xxxxxx-xxxxxxxx59641/oauth2/v2.0/authorize?response_type=code&client_id=xxxxxxx-1xxxx-xxxx-ad2a-d80d3f51638a&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient&scope=Files.ReadWrite%20openid%20User.Read%20Mail.Send%20Mail.ReadWrite

Note: The Above step is highligted in the documentation

Is this because I dont have check the box checked next to oauth2/nativeclient which is mention at Step 4 Point 8 in the documentation.

Any guidance will be great help


回答1:


The command line interface opens a browser window on the Azure Active Directory authorization endpoint. Enter your user name and password to authenticate. When you are authenticated, you're taken to an authorization window for the sample app. Review and accept the scopes requested by the sample app. Click the Ok button on the authorization window.

When you got that url, you should be asked to login. After that, you will get the code.

The steps:

Register an app on Azure portal->get the client id-> go to Constants.java class and replace the client_id with yours.

Run the PublicClient class.

Login in with your account, then you will get the code.



来源:https://stackoverflow.com/questions/57290670/incorrect-redirect-url-address-while-working-with-microsoft-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!