Sp-dev-docs: When using the MSGraphClient you get the 'AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: 'c58637bb-e2e1-4312-8a00-04b5ffcd3403'.' error

Created on 11 May 2018  路  13Comments  路  Source: SharePoint/sp-dev-docs

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Connect to the Microsoft Graph from SPFx using the MSGraphClient

Observed Behavior

After adding a web part using the MSGraphClient to the page, you're being redirected to Azure AD where you get the following error:

AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: 'c58637bb-e2e1-4312-8a00-04b5ffcd3403'.

URL: https://login.microsoftonline.com/69faea77-d304-4dc8-9e2c-95b1e9897054/oauth2/authorize?response_type=id_token%20token&client_id=c58637bb-e2e1-4312-8a00-04b5ffcd3403&resource=c58637bb-e2e1-4312-8a00-04b5ffcd3403&redirect_uri=https%3A%2F%2Fm365x526922.sharepoint.com%2F_forms%2Fspfxsinglesignon.aspx&state=a91f07af-e576-4de7-9f3c-188c17686a8c%7Cc58637bb-e2e1-4312-8a00-04b5ffcd3403&client-request-id=dc6bd7b4-9f3e-4fae-83d2-e5d99aeb598c&x-client-SKU=Js&x-client-Ver=1.0.16&nonce=7a596e19-3e85-466d-8ae0-832c64637b18&prompt=none&iframe-request-id=eb5ff16c-43bd-4d25-a05d-15edfb0d0900

Steps to Reproduce

  • create new SPFx v1.4.1 project with a web part using the MSGraphClient
  • bundle, package and deploy the solution to SharePoint Online
  • add the web part to the page > error

The tenant is using 2018-05-04.012 release of the SharePoint Framework

spfx-general tracked bug-suspected

All 13 comments

This can be resolved by going to modern Admin UI where the permissions are managed. Those pages will automatically make sure that your tenant has the correct configuration. This is not done if you only use PowerShell or other routes for the permission management. This is a bug which will be resolved, but the admin UI trick is a short-term workaround.

Can you please provide specific steps for this?

I am also receiving this error in my SPFX app. Which admin UI do we make this change? Sharepoint admin? azure ad?

  • go to https://yourtenant-admin.sharepoint.com
  • in the upper-right corner, click the Try the preview button, that will take you to the new SharePoint admin center
  • from the sidebar, click the API management link

Opening this page should trigger provisioning the necessary configuration.

@waldekmastykarz We experience the same error in our customer's environment. The workaround mentioned is not solving the issue. I can see the App id of the SharePoint Online Client Extensi... app differs from the one in the SPFx graph authentication call:

image

image

I guess that's the main cause of this error. Already contacted MS Support but no fix from their side yet...

I also guess that removing the OOTB app registration of SPFx is not the solution for this?!

Which version of the SharePoint Framework are you using @advdberg?

for this app SharePoint Framework v1.4.1

Could you check if you can repro the issue on [email protected]? There were quite a few changes related to AAD in 1.6.0 and it could be that the version you're using doesn't work correctly with the GA version of the server configuration.

Thanks for the suggestion, we'll try to update the solution to 1.6.0 and check if that's the fix

Having the same problem on 1.6.0 here, none of the workarounds seem to do anything.

Looked into this further. I see a lot of the libraries are hard-coding the aformentioned GUID in many places. Our SP Client Online app in Azure AD has a different ID. Doing a find and replace all in node_modules, switching the hard-coded ID for our app ID got it working.

Obviously this is a far from ideal solution. Any ideas?

@waldekmastykarz @JakeStanger We鈥檝e managed to update our solution to SharePoint Framework 1.6 (with some help from the CLI, thanks Waldek 馃憤) and this seems to be (at least part of) the solution for this issue. The only thing else I can imagine of is that we also replaced an old PnP Graph call used in the solution by a call with the MSGraphClient so maybe that was also part of the issue...

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings