function importFromAuthObject(kbaseSession) {
                // Auth object has fields un, user_id, kbase_sessionid, token. If any are missing, we void the session (if any)
                // cookies and pretend we have nothing.
                // NB: the object returned from the auth service does NOT have the un field.
                if (!(kbaseSession.kbase_sessionid && kbaseSession.user_id && kbaseSession.token)) {
                    // throw new Error('Invalid Kbase Session Cookie');
                    removeSession();
                    return null;
                }
                var newSession = {
                    username: kbaseSession.user_id,
                    realname: kbaseSession.name,
                    token: kbaseSession.token,
                    tokenObject: decodeToken(kbaseSession.token),
                    sessionId: kbaseSession.kbase_sessionid
                };

                if (validateSession(newSession)) {
                    return newSession;
                }
                return null;
            }
/**
             * Creates a valid standard Session Object from a raw session object
             * provided by Globus.
             * 
             * @function importSessionFromAuthObject
             * @private
             * 
             * @param {KBaseSessionObject} kbaseSession - the session object
             * returned from the KBase auth server
             * @returns {SessionObject|null} a validated Session Object, or null
             * if no session or an invalid session was provided.
             */
Creates a valid standard Session Object from a raw session object
provided by Globus.



@param {KBaseSessionObject} kbaseSession - the session object
returned from the KBase auth server
@returns {SessionObject|null} a validated Session Object, or null
if no session or an invalid session was provided.
Creates a valid standard Session Object from a raw session object provided by Globus . @param { KBaseSessionObject } kbaseSession - the session object returned from the KBase auth server @returns { SessionObject|null } a validated Session Object or null if no session or an invalid session was provided .
function importFromAuthObject(kbaseSession) {
                if (!(kbaseSession.kbase_sessionid && kbaseSession.user_id && kbaseSession.token)) {
                    removeSession();
                    return null;
                }
                var newSession = {
                    username: kbaseSession.user_id,
                    realname: kbaseSession.name,
                    token: kbaseSession.token,
                    tokenObject: decodeToken(kbaseSession.token),
                    sessionId: kbaseSession.kbase_sessionid
                };
                if (validateSession(newSession)) {
                    return newSession;
                }
                return null;
            }
function importFromAuthObject ( kbaseSession ) { if ( ! ( kbaseSession . kbase_sessionid && kbaseSession . user_id && kbaseSession . token ) ) { removeSession ( ) ; return null ; } var newSession = { username : kbaseSession . user_id , realname : kbaseSession . name , token : kbaseSession . token , tokenObject : decodeToken ( kbaseSession . token ) , sessionId : kbaseSession . kbase_sessionid } ; if ( validateSession ( newSession ) ) { return newSession ; } return null ; }
Creates a valid standard Session Object from a raw session object
 provided by Globus.
Creates a valid standard Session Object from a raw session object provided by Globus .
// Auth object has fields un, user_id, kbase_sessionid, token. If any are missing, we void the session (if any) // cookies and pretend we have nothing. // NB: the object returned from the auth service does NOT have the un field. // throw new Error('Invalid Kbase Session Cookie');