Every time I initiate this call, it triggers the account selector to open. Following which I can choose one of my Google accounts, but upon selection, an error occurs.
Error: invalid_request
Missing required parameter: scope
The URL in the account selector shows the presence of the scope variable, yet it somehow gets lost when the account is selected. Please note that I have altered my client ID in this particular example. Appreciate any assistance provided.
app.controller("FirstController", function($scope, $location) {
$scope.redirectToGoogle = function () {
console.log("redirectToGoogle");
var client_id="myclientID";
var scope="profile email";
var redirect_uri="http://localhost:8080/auth/google/callback/";
var response_type="token";
var url="https://accounts.google.com/o/oauth2/auth?&client_id="+client_id+"scope="+scope+"&redirect_uri="+redirect_uri+"&response_type="+response_type;
window.location.replace(url);
}
});