barry.hutchison Posted September 11, 2018 Share Posted September 11, 2018 I have enabled token authentication on my server (6.2.1) and only want to permit the token to be passed through the headers NOT URL. How do I then login to visualize.js? Since the auth object of visualize.js seems to pass the auth object token property to the URL. visualize({ server: window.location.origin + '/jasperserver-pro', auth: { token: token, preAuth: true, tokenName: "pp" }}[/code]The above doesn't work. There is a headers property in the documentation but the syntax isn't clear I was hoping someone could point me in the right direction. Cheers Link to comment Share on other sites More sharing options...
puneet.040289 Posted March 8, 2019 Share Posted March 8, 2019 To pass token in request header , you have to use loginFn of visualize.js:visualize({ auth: { preAuth: true, token:token, loginFn:function(properties,request){ return request({ url:<URL of jasper report server>, type:"get", headers:{"pp":properties.token,"Accept":"application/json"} }); } } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now