Jump to content
Changes to the Jaspersoft community edition download ×

Visualize.js authentication error after second login


Go to solution Solved by ry_15_yan,

Recommended Posts

I have a website—utilizing Visualize.js—that has a simple login/logout feature. Everytime I login I call

the authenticateUser() and logout destroySession() method. When I try login and then logout and then login again, when I

try to render my existing reports I get this thrown error:

 

HTTP Status 401 - Full authentication is required to access this resource[/code]

 

The functions authenicateUser() and destroySession() are shown below:

 

function authenticateUser () {    var myConfig = {        auth : {            name     : "superuser",            password : "superuser"        }    };    visualize.config( myConfig );}function destroySession() {    visualize( function ( v ) {        // Logout form JRS and finish the session.        v.logout().done( function () {        } );    } )}[/code]

 

I would like to point out that when I first login my account this error is not thrown and renders the reports perfectly.

Why is this happening after logout and then login again?

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I'm not 100% sure about this but from playing around with visualize in my own app it seems that config doesn't actually make the REST call to the server for the authentication, but only sets up the credentials for when another visualize function is called, which is useful for running multiple containers with shared credentials. To troubleshoot you may want to try just the simple authentication methods shown in the cookbook and work up from there.

Link to comment
Share on other sites

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...