Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.Net Identity: invalid_request on redirect when calling REST function GetExternalLogin

This error applies to the Single Page Application template when selecting the ASP.NET Web Application project in Visual Studio. Add a valid Facebook appId and appSec to the Startup.Auth.cs file to test the demo with external login.

I am able to login into Facebook but only if the redirect url which is defined in app.datamodel.js in the js variable siteUrl is set to '/' . As expected, when the call is made to the GetExternalLogin REST function inside the AccountController the user is sent to the Facebook page to do the external login. If I put a breakpoint inside the GetExternalLogin it is triggered as well.

However, if I change the siteUrl in the app.datamodel.js to anything else e.g. '/dummyController' the breakpoint is not triggered at all, instead the response gives the message error: invalid_request

Any idea why this does not work? Thanks!

like image 237
doorman Avatar asked Jan 06 '14 15:01

doorman


1 Answers

To set a valid redirect url I had to set it inside the ValidateClientRedirectUri inside the ApplicationOAuthProvider.cs file

like image 66
doorman Avatar answered Oct 29 '22 21:10

doorman