sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

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

Open waldekmastykarz opened this issue 8 years ago • 13 comments

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

waldekmastykarz avatar May 11 '18 09:05 waldekmastykarz

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.

VesaJuvonen avatar May 15 '18 17:05 VesaJuvonen

Can you please provide specific steps for this?

jignesh84 avatar Jul 24 '18 16:07 jignesh84

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

joewashek avatar Aug 29 '18 03:08 joewashek

  • 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 avatar Aug 29 '18 05:08 waldekmastykarz

@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?!

advdberg avatar Sep 26 '18 09:09 advdberg

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

waldekmastykarz avatar Sep 26 '18 17:09 waldekmastykarz

for this app SharePoint Framework v1.4.1

advdberg avatar Sep 26 '18 19:09 advdberg

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.

waldekmastykarz avatar Sep 27 '18 09:09 waldekmastykarz

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

advdberg avatar Oct 01 '18 08:10 advdberg

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

JakeStanger avatar Oct 04 '18 12:10 JakeStanger

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?

JakeStanger avatar Oct 05 '18 10:10 JakeStanger

@waldekmastykarz @JakeStanger We’ve 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...

advdberg avatar Oct 09 '18 14:10 advdberg

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

msft-github-bot avatar Jan 27 '20 18:01 msft-github-bot