This is my visualize.js code for token based authentication, but it doesn"t work, please some one can help me to solve this???
<script type="text/javascript" src="http://localhost:8083/jasperserver-pro/client/visualize.js?_opt=false&lo..."></script>
<script type="text/javascript">
var authToken = encodeURIComponent("u=prabhath|r=role|o=EMEA|pa1=Sweden");
visualize.config({
server: "http://localhost:8083/jasperserver-pro",
scripts: "optimized-scripts",
logEnabled: true,
logLevel: "error",
auth: {
token: authToken,
preAuth: true,
tokenName: "pp"
}}, function (v) {
$scope.v = v;
$scope.reportingInitialized = true;
$scope.$digest();
}, function (err) {
alert("Auth error! Server said: " + err.message);
});
</script>
1 Answer:
Posted on November 23, 2015 at 12:59pm
Are you getting an error? Can you see the /auth call being made in your browser console?
Our token auth looks a little different than yours:
visualize({
auth: {
token: theToken,
tokenName: "ticket"
}
}, function(v){
_reportService = v;
_exportFormats = v.report.exportFormats;
}, function(err){
_handleError("An error occurred while attempting to connect to the reporting service. " + err.message, err);
});
Hi,
Thanks for the reply. I realized my code is ok. wrong is I didn"t configure the jasperserver correctly to the token based authentication. thank you for your reply :)