Jump to content
We've recently updated our Privacy Statement, available here ×

Token based authentication in visualize.js


Recommended Posts

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&logLevel=debug"></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>
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...