isAuthorized() with 2 JSDOSessions Authenticated and UnAuthe

Posted by kh-it on 10-Sep-2017 07:34

Dear,

We have a problem with our page refresh the isAuthorized() return yes when another JSDOSession(UnAuthenticated) is loaded. Even if the JSDOSession is the FORM and not the ANON JSDOSession.

Vars:

    authUnAuthenticated = new progress.data.AuthenticationProvider({
      authenticationModel: progress.data.Session.AUTH_TYPE_ANON,
      uri: ServiceURI
    });
    auth = new progress.data.AuthenticationProvider({
      authenticationModel: progress.data.Session.AUTH_TYPE_FORM,
      uri: ServiceURI
    });


Login:

        auth.login(pUser, pPassword).done(function(session, result, info) {
          session = new progress.data.JSDOSession({
            serviceURI: ServiceURI,
            authenticationModel: progress.data.Session.AUTH_TYPE_FORM,
            name: "ApplicationName",
            authProvider: auth
          });


Check at page refresh:

JSDOSession = new progress.data.JSDOSession({
  serviceURI: ServiceURI,
  authenticationModel: progress.data.Session.AUTH_TYPE_FORM,
  name: "ApplicationName", //pApplicationName
  authProvider: auth
});
return JSDOSession;

Load UnAuthenticated:

progress.data.getSession({
            serviceURI: ServiceURI,
            catalogURI: PreCatalogURI + "UnAuthenticatedService.json",
            authenticationModel: progress.data.Session.AUTH_TYPE_ANON,
            name: "ApplicationNameUnAuthenticated",
            authProvider: authUnAuthenticated
        })

isAuthorized:

If page refresh occurs I do :

  JSDOSession.isAuthorized() .done(function(session, result, info) {


If I check the properties it's really from the FORM and not ANON but it return that it's authenticated. Why?

Is this a problem because I'm using the same ServiceURI.
I thought it should check the 2 JSDOSessions separately. Or do I have to extend the jsdo library for this.
I'm searching for a while after this problem without success. I hope somebody can help.

Progress version: 11.7.1
JSDO: 4.4

Thank you in advance
KH-IT



All Replies

This thread is closed