I wonder how I can get claims back when authenticating users with azure mobile services using Azure AD.
I'm using azure mobile services to authenticate users in a phonegap app. The authentication flow works fine, the response I get back from the service is as follows
{
"userId": "Aad:o5ExTvSOMETHING_HEREpb0c",
"mobileServiceAuthenticationToken": "A_TOKEN"
}
How can I get profile properties like full name, sign in name etc, so that I could at least output something like "Hello Lars", "Lars" being a claim returned.
After logging in, I redirect the user back to "home":
LoginController.prototype.doLogin = function() {
var that = this;
client.login('Aad').done(function(response) {
that.ons.navigator.resetToPage("page1.html", { title: 'Home' });
}, function (error) {
console.log(error);
});
};
When HomeController runs after signing in, client.currentUser is an object with the structure above:
HomeController = function($scope) {
$scope.controllerhello = "Welcome home!";
if(client.currentUser == null) {
$scope.ons.navigator.pushPage("login.html", { title: 'Sign in' });
}
};
What I had hoped was a response like this:
{
"userId": "Aad:o5ExTvSOMETHING_HEREpb0c",
"mobileServiceAuthenticationToken": "A_TOKEN",
"claims": {
userName: "[email protected]",
fullName: "Lars"
}
}
How, if, can I get these claims. Does it have to do with the application manifest under manage azure AD -> applications -> manage manifest ?