angularjs - Azure get token with JavaScript Angular -



angularjs - Azure get token with JavaScript Angular -

this code:

$scope.gettoken = function() { // $scope.connect() $http( { method: 'post', url: $scope.urltogettoken, params: $scope.authparams, headers: {"content-type": 'application/x-www-form-urlencoded'} } ). success(function(data){ console.log("whatever" + data); }). error(function(data, status, headers, config){ console.log(data); console.log(headers); console.log(config); }) $scope.authparams = { grant_type: 'authorization_code', client_id: '03b****************ba-931c-3b19f204c736', code: 'aaabaaaav*********b', redirect_uri: 'localhost:8080' }

despite grant_type parameter there getting 400 next error:

"aadsts90014: request body must contain next parameter: 'grant_type'. ↵trace id:

what about?

params used send info in querysting.

use data send info in post body.

$http({method: 'post', url:$scope.urltogettoken, data:$scope.authparams, headers:{

javascript angularjs azure oauth

Comments

Post a Comment

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -