I'm running into the following error when trying to post to my identityserver using "https://localhost:44333/identity/connect/token" from my angularjs authService, but when I post from Postman or Fiddler all works fine.
I have self created a certificate which I imported and so when I navigate to https://localhost:44333/identity in my browser all is good.
What I could gather from googling around was that it had something to do with certificates, but I can only find topics on node.js. I'm trying to authenticate from a angularjs service to an IdentityServer3 which I selfhosted on the above url using owin.
The following is what my angulajs login code looks like:
var _login = function (credentials) {
var user = { grant_type: 'password', username: credentials.userName, password: credentials.password, scope: 'salesApi' }
var urlEncodedUrl = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic ' + base64Encoded
};
console.log(base64Encoded);
$http.post(serviceBase + 'connect/token', { headers: urlEncodedUrl }, { data: user }).success(function (data, status, headers, config) {
localStorageService.set('authorizationData', { bearerToken: data.access_token, userName: credentials.userName });
_authentication.isAuth = true;
_authentication.userName = credentials.userName;
_authentication.bearerToken = data.access_token;
}).error(function (err, status) {
console.log(err);
_logOut();
});
};
Any ideas on what I'm missing or how to solve this error?
UPDATE: Is this actually a ripple emulator or cordova issue?