Login validation session info.

@param info the info
@param req  the req
@param res  the res
@return the validation session info
329537
@PostMapping("/setting/auth")
    public ValidationSessionInfo login(@RequestBody ValidationLoginInfo info, HttpServletRequest req, HttpServletResponse res) {
        return this.validationSessionComponent.checkAuth(info, req, res);
    }
1183904
function loginCallback(req, res, test) {
  var state = JSON.parse(req.query.state);
  console.dir( state );
  var protocol = "https://";
  if(test === true || req.test) protocol = "http://";  //for testing

  var url = protocol + state.loginServer + "/services/oauth2/token";

  var options = {
    code: req.query.code,
    grant_type: 'authorization_code',
    client_id: process.env.SALESFORCE_CLIENT_ID,
    redirect_uri: process.env.SALESFORCE_REDIRECT_URL,
    client_secret: process.env.SALESFORCE_CLIENT_SECRET
  }
  
  request.post(url)
  .type("application/x-www-form-urlencoded")
  .send(options)
  .on("error", function(err){ return onError(res,err); })
  .end(function(sfRes){
    if(sfRes.error) return onError(res, sfRes.error);
    console.dir( sfRes.body )
    req.session.salesforce = JSON.stringify( sfRes.body );
    res.redirect(state.appUrl)
  })
}
72514
public base_response loginchallengeresponse(String response) throws Exception
	{
		loginchallengeresponse logincr = new loginchallengeresponse(response);
		base_response result = logincr.perform_operation(this);
		if (result.errorcode == 0)
			this.sessionid = result.sessionid;
		return result;
	}
139548
private static boolean isRequired(ValidatorInfo info) {
		if (null != info) {
			for (ConstraintInfo constraint : info.getConstraints()) {
				if (constraint instanceof NotNullConstraintInfo) {
					return true;
				}
			}
		}
		return false;
	}
158480
function handleLogin(req, res, next) {
		var p = new Promise(function (resolve, reject) {
			const loginHandler = function (err, user, info) {
				if (err) {
					debug(`Error during user login`, err);
					return reject(err);
				}
				if (!user) {
					debug(`Login user not found or invalid credentials`, info);
					reject(new restifyErrors.InvalidCredentialsError("Incorrect username or password"));
				} else {
					const data = {
						'success': true,
						'token': req.locals.basic_login_token
					};
					resolve(data);
				}
			};

			debug(`Handling user login`);
			passport.authenticate('basic', {
				session: false
			}, loginHandler)(req, res);
		}).then(function (data) {
			res.json(data);
			next();
		}).catch(function (err) {
			debug(`Error during login request.`, err);
			next(err);
		});
	}
157041
function(req,res,next){
  var token = req.get('X-OOSE-Token')
  if(!token || user.session.token !== token){
    res.status(401)
    res.json({error: 'Invalid session'})
  } else {
    req.session = user.session
    next()
  }
}
17735
public UserLogin ensureLoginOnSession(HttpSession session)
	{
		if (session.getAttribute(LOGIN_SESSION_ATTRIBUTE) == null)
			// Fall back on the anonymous user
			// Save in the "login" session attribute
			session.setAttribute(LOGIN_SESSION_ATTRIBUTE, new UserLoginImpl(null));

		return (UserLogin) session.getAttribute(LOGIN_SESSION_ATTRIBUTE);
	}
406507
private void loginForm(HttpServletResponse response) {
        response.reset();
        response.addHeader("WWW-Authenticate",
                           "Basic realm=\"!!Fedora Repository Server\"");
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    }
769919
public function checkLogin($data, HTTPRequest $request, ValidationResult &$result = null)
    {
        $member = $this->authenticator->authenticate($data, $request, $result);
        if ($member instanceof Member) {
            return $member;
        }

        return null;
    }
659488
@Override
	public Result<Void> getCertInfoByID(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, String id) {
		TimeTaken tt = trans.start(GET_CERT_BY_ID, Env.SUB|Env.ALWAYS);
		try {	
			Result<CERTS> rci = service.getCertInfoByID(trans,req,id);
			
			switch(rci.status) {
				case OK: 
					if(Question.willSpecialLog(trans, trans.user())) {
						RosettaData<CERTS> data = certsDF.newData(trans).load(rci.value);
						Question.logEncryptTrace(trans,data.asString());
						data.to(resp.getOutputStream());
					} else {
						certsDF.direct(trans, rci.value, resp.getOutputStream());
					}
					setContentType(resp,certsDF.getOutType());
					return Result.ok();
				default:
					return Result.err(rci);
			}
		} catch (Exception e) {
			trans.error().log(e,IN,GET_CERT_BY_ID);
			return Result.err(e);
		} finally {
			tt.done();
		}
	}
447266
public static String getSessionID(HttpServletRequest req) {
        String sessionID = null;
        final HttpServletRequest f_req = req;

        try {
            sessionID = AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
                @Override
                public String run() throws Exception {
                    HttpSession session = f_req.getSession();
                    if (session != null) {
                        return session.getId();
                    } else {
                        return null;
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            if ((e.getException()) instanceof com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException) {
                if (!req.isRequestedSessionIdFromCookie()) {
                    sessionID = AccessController.doPrivileged(new PrivilegedAction<String>() {
                        @Override
                        public String run() {
                            return f_req.getSession().getId();
                        }
                    });
                } else {
                    sessionID = AccessController.doPrivileged(new PrivilegedAction<String>() {
                        @Override
                        public String run() {
                            return f_req.getRequestedSessionId();
                        }
                    });
                }

            }
        } catch (com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException e) {
            try {
                if (!req.isRequestedSessionIdFromCookie()) {
                    sessionID = AccessController.doPrivileged(new PrivilegedAction<String>() {
                        @Override
                        public String run() {
                            return f_req.getSession().getId();
                        }
                    });
                } else {
                    sessionID = AccessController.doPrivileged(new PrivilegedAction<String>() {
                        @Override
                        public String run() {
                            return f_req.getRequestedSessionId();
                        }
                    });
                }

            } catch (java.lang.NullPointerException ee) {
                sessionID = "UnauthorizedSessionRequest";
            } catch (com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException ue) {
                sessionID = "UnauthorizedSessionRequest";
            }

        }
        return sessionID;
    }
848214
function session(req, res, next) {
    //
    // The session id is stored in the cookies.
    // `req.signedCookies` is assigned by the `cookie-parser` middleware.
    //
    var sid = req.signedCookies[key];

    //
    // Default to an empty session.
    //
    req.session = {};

    //
    // If we don't have a session id we are done.
    //
    if (!sid) return next();

    //
    // Grab the session from the store.
    //
    store.get(sid, function (err, session) {
      //
      // We don't want to kill the connection when we get an error from the
      // session store so we just log the error.
      //
      if (err) {
        primus.emit('log', 'error', err);
        return next();
      }

      if (session) req.session = session;

      next();
    });
  }
760710
private AuthenticationResult handleFormLogin(HttpServletRequest req, HttpServletResponse res, WebRequest webRequest) {
        AuthenticationResult authResult = null;
        authResult = ssoAuthenticator.authenticate(webRequest);

        if (authResult != null) {
            authResult.setAuditCredType(AuditEvent.CRED_TYPE_FORM);
        }

        if (authResult != null && authResult.getStatus() != AuthResult.FAILURE) {
            postParameterHelper.restore(req, res);
            return authResult;
        }

        try {
            authResult = providerAuthenticatorProxy.authenticate(req, res, null);
        } catch (Exception e) {
            return new AuthenticationResult(AuthResult.FAILURE, e.getLocalizedMessage());
        }

        if (authResult.getStatus() == AuthResult.CONTINUE) {
            authResult = null;
            if (webRequest.isFormLoginRedirectEnabled()) {
                authResult = handleRedirect(req, res, webRequest);
                if (authResult != null) {
                    authResult.setAuditCredType(AuditEvent.CRED_TYPE_FORM);
                    authResult.setAuditOutcome(AuditEvent.OUTCOME_REDIRECT);
                }

            }
        }
        return authResult;
    }
145423
function post_login(urlStr, username, password, token, next) {

    assert(_.isFunction(next));

    var p = url.parse(urlStr);


    var http_protocol;
    if (p.protocol === "https:") {
        http_protocol = https;
    } else {
        http_protocol = http;
    }

    var options = {
        host: p.hostname,
        path: url.resolve(p.pathname, "login"),
        method: "POST",
        user_agent: "Mozilla/5.0"

    };

    var req = http_protocol.request(options, function (res) {
        // console.log('STATUS: ' + res.statusCode);
        // console.log('HEADERS: ' + JSON.stringify(res.headers,null," "));

        res.setEncoding('utf8');

        res.on('data', function (chunk) {
            //xx data += chunk
        });
        res.on('end', function () {


            var selected_elements = res.headers["set-cookie"].filter(function (str) {
                //  1234567890123456
                return str.substr(0, 16) === "_redmine_session";
            });

            assert(selected_elements.length === 1);
            var _cookie_session = selected_elements[0] + "; domain=" + p.hostname;
            next(null, _cookie_session);
        });
    });

    req.on('error', function (err) {
        console.log('problem with request: '.red + err.message);
        next(err);
    });

    // write data to request body
    req.write("username=" + username + "&password=" + password + "&authenticity_token=" + token + "\n");
    req.end();

}
14515
function(req, res) {

      req.session.authenticated = false;

      var defaultString = 'You have successfully logged out.';

      // now respond or redirect
      var postResponse = this._resolvePostAction(waterlock.config.postActions.logout.success,
        defaultString);

      if (typeof postResponse === 'string' && this._isURI(postResponse)) {
        res.redirect(postResponse);
      } else {
        res.ok(postResponse);
      }
    }
199685
function (req, res, options) {
    if (!options) {
      options = {};
    }
    options.operation = 'REMOVE';
    options.res = res;
    if (!options) {
      options = {};
    }
    if (req.params.model) {
      options.model = req.params.model;
    }
    if (req.params.query) {
      options.query = req.params.query;
    }
    if (req.params.id) {
      options.query = {
        _id: req.params.id,
      };
    }
    exports.remove.before(req, res, options);
    var userId = req.session['user-id'];
    vulpejs.models.remove({
      model: options.model,
      item: {
        _id: req.params.id,
      },
      query: options.query,
      validate: options.validate || false,
      userId: userId,
      callback: {
        success: function (item) {
          if (!vulpejs.utils.execute(options.callback, {
              item: item,
              res: res,
            })) {
            exports.remove.after(req, res, item);
            res.json({
              item: item,
            });
          }
        },
        error: function (error) {
          exports.response.error(options, error);
        },
        validate: function (validate) {
          exports.response.validate(options, validate);
        },
      },
    });
  }
568124
private String getCustomReloginErrorPage(HttpServletRequest req) {
        String reLogin = CookieHelper.getCookieValue(req.getCookies(), ReferrerURLCookieHandler.CUSTOM_RELOGIN_URL_COOKIENAME);
        if (reLogin != null && reLogin.length() > 0) {
            if (reLogin.indexOf("?") < 0)
                reLogin += "?error=error";
        }
        return reLogin;
    }