0
私はAzure Ad認証サービスを使用するサンプルアプリケーションを開発しています。私はadal-angular、adal jsを使用して検証を実行しました。私は正常にログインできますが、受信したトークン、誰も私が行方不明を見つけるのを助けることができますか?azure AD adalAuthenticationServiceがトークンを読み取ることができません
コードスニペット:
var app = angular.module("myApp", ["ngRoute","AdalAngular"]);
app.config(["$httpProvider","adalAuthenticationServiceProvider",function($httpProvider,adalProvider) {
/*var endpoints ={
"http://localhost:8080/index.jsp/":"https://thirumalaivstgit.onmicrosoft.com/sampangular"
};*/
adalProvider.init(
{
instance: "https://login.microsoftonline.com/",
tenant: "thirumalaivstgit.onmicrosoft.com",
clientId: "f1f7aafc-8901-4755-bb66-a46eae527e33",
redirectUri: 'http://localhost:8080/index.jsp'
},$httpProvider);
}]);
app.controller("getvaluecontroller",["$scope","$http","adalAuthenticationService",function($scope,$http,adalService){
$scope.appname="dfsfgggsgsdg";
$scope.claims = [];
$scope.login=function(){
var loginvalue=adalService.login();
console.log(loginvalue);
}
$scope.userSignedIn=function(err, token)
{
console.log('userSignedIn called');
if (!err) {
console.log("token: " + token);
}
else {
console.error("error: " + err);
}
}
$scope.logout=function(){
adalService.logOut();
}
$scope.afterlogin=function()
{
console.log("afterlogin::" +adalService);
adalService.acquireToken("https://thirumalaivstgit.onmicrosoft.com",function(errorDesc,token,error){
console.log("afterlogin error");
console.log(errorDesc);
console.log(token);
console.log(error);
});
console.log("afterlogin000000");
}
$scope.getvalue=function()
{
console.log("asdfasdfsdfg");
console.log("getvalue::"+adalService.userInfo.profile);
for (var property in adalService.userInfo.profile) {
if (adalService.userInfo.profile.hasOwnProperty(property)) {
$scope.claims.push({
key: property,
value: adalService.userInfo.profile[property],
});
}
}
console.log("getvalue");
}
}])