6

I am using Kinvey to handle Oauth on my AngularJS app, and it works just fine for Facebook, but when I try to sign in with Google, I am getting a 400 error:

Error: invalid_request

Invalid parameter value for redirect_uri: Fragment not allowed: localhost:9000/#/login

Has anyone ever encountered this issue with Google Oauth and Angular? Any ideas on how I can get around it? The issue stems from the hash in the URL for Angular's routing.

kanzelm3
  • 535
  • 3
  • 12
  • Redirect uri must be the same as the one you entered in the dev console for your application which is probably more like http :// localhost:9000/#/login – Linda Lawton - DaImTo Jun 17 '14 at 07:50

1 Answers1

3

The # is called a fragment identifier. The error Fragment not allowed: means you must replace the # with an alternative, such as:

  • localhost:9000/route/login

Then redirect with Kinvey:

req.request({uri: 'http://localhost:9000/route/login',
method: 'GET'},
function(error, response, body){
  response.statusCode = 302; 
  response.setHeader("Location", "/#/login");
  response.end();
  }
);

Here are some unrelated questions with similar issues:

Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265