cancel
Showing results for 
Search instead for 
Did you mean: 

this._initAuthentication is not a function

Robson_
Champ in-the-making
Champ in-the-making

It's my first time using nuxeo.js. I added nuxeo.js to the asp.net mvc application Scripts folder and made the reference to it in my .aspx page head section. I'm trying to access nuxeo server with this code:

$(document).ready(function () {
/> var client = new nuxeo.Client({
/>
/> baseURL: 'http://192.168.15.128/nuxeo',
/> restPath: 'api/v1',
/> automationPath: 'site/api/v1/automation',
/> auth: {
/> method: 'basic',
/> username: 'myusername',
/> password: 'mypassword'
/> },
/> timeout: 30000
/> })
/> });
/>

My browser console error list always get the message: "Uncaught TypeError: this._initAuthentication is not a function"

Debugging I realized that in line 43 of nuxeo.js we have a call to this._initAuthentication() and I can't find the implementation to this function. I am probably missing something.

Can anyone give me a help?

4 REPLIES 4

Thomas_Roger
Star Contributor
Star Contributor

Hi,

My bad, I've done a fix.

You can try to use the updated client: https://github.com/nuxeo/nuxeo-js-client/blob/master/lib/jquery/nuxeo.js

Will post a new version 0.5.1 to bower (if you're using it).

Thanks for the report.

Robson_
Champ in-the-making
Champ in-the-making

Now I don't get any error but the object client has always it's connected property set to false. I'm sure that it's not connected because even if I put a wrong password I have the same client object as return. Furthermore, every request I try to do like the example below gives null as return.

Thomas_Roger
Star Contributor
Star Contributor

Could you share your whole code? Through a gist for instance.

Thanks.

Robson_
Champ in-the-making
Champ in-the-making

I'm just trying to get any data from the nuxeo server using nuxeo.js in my asp.net MVC application. So my code is exactly this