Token based authentication in visualize.js

0

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">
 
var authToken = encodeURIComponent("u=prabhath|r=role|o=EMEA|pa1=Sweden");
visualize.config({
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>
anuradhe.prabhath's picture
Joined: Nov 13 2015 - 2:30am
Last seen: 3 years 4 months ago

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 :)

anuradhe.prabhath - 3 years 7 months ago

1 Answer:

0

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);
            });

jclarke_1's picture
Joined: Feb 9 2015 - 9:09am
Last seen: 2 years 5 months ago
Feedback
randomness