09-15-2015 06:38 PM
Hello community
I'm having some problems with chrome and the basic authentication (jquery) with the javascript client from nuxeo. I have a form based login which works fine when the credentials are ok, but when the authentication fails, I get a popup from chrome asking for the credentials again. I have spent some time doing research and found out that this happens because chrome is getting a 401 response, and it automatically shows the popup. I tried several solutions as altering the Authorization header to other thing than "Basic ..." but I haven't had any luck. I wonder if any of you guys have come across this before and found a workaround.
This is my connection code, nuxeo's js library is untouched.
var nuxeoclient = new nuxeo.Client({
baseURL: 'http://localhost:8080/nuxeo',
restPath: 'site/api/v1',
automationPath: 'site/api/v1/automation',
auth: {
method: 'basic',
username: form.username.value,
password: form.password.value
},
timeout: 30000
})
var h = nuxeoclient._headers;
nuxeoclient._computeAuthentication(h);
nuxeoclient.connect(function(error, client) {
if (error) {
//do stuff
}else{
///blah blah
}
});
09-16-2015 10:39 AM
Hi,
You can add the X-No-Basic-Header header to avoid browser popup for authentication.
...
client.header('X-No-Basic-Header', true);
client.connect(...)
...
09-16-2015 10:39 AM
Hi,
You can add the X-No-Basic-Header header to avoid browser popup for authentication.
...
client.header('X-No-Basic-Header', true);
client.connect(...)
...
09-17-2015 10:32 AM
Thank you Thomas, it worked!
Attention: Blogs & Forums are in READ-ONLY mode from Oct 6-19 as we transition to our new platform. Learn more.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.