I tried this to get the token :
AP.context.getToken(function(token){
console.log("JWT token string", token);
});
and tried this to get the user details :
AP.user.getCurrentUser(function(user) {
console.log("The Atlassian Account ID is", user.atlassianAccountId);
});
but both didn't work