Alon Bar-Lev has posted comments on this change.

Change subject: aaa : Add engine sso
......................................................................


Patch Set 47:

(6 comments)

good!

even more debug...

each servlet when it enters and leave, each redirect, query parameters that are 
important to logic, change of state between phases.

https://gerrit.ovirt.org/#/c/36119/47/backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase1Servlet.java
File 
backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase1Servlet.java:

Line 16:     private static final long serialVersionUID = -88168919566901736L;
Line 17: 
Line 18:     @Override
Line 19:     protected void service(HttpServletRequest request, 
HttpServletResponse response)
Line 20:             throws ServletException, IOException {
login phase1 entered and query string or at least what we require
Line 21:         if 
(StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) {
Line 22:             throw new RuntimeException("No post action url found in 
request.");
Line 23:         }
Line 24: 


Line 44:             SSOConfig config = (SSOConfig) 
request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG);
Line 45:             String externalParamValue = 
request.getParameter("external");
Line 46:             boolean disableExternal = 
config.isAllowDisableExternalAuth() &&
Line 47:                     StringUtils.isEmpty(externalParamValue) ? false : 
"0".equals(externalParamValue);
Line 48:             if (config.isEnableExternalAuth() && !disableExternal) {
redirecting to ...
Line 49:                 response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_EXTERNAL_URI);
Line 50:             } else {
Line 51:                 response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_PHASE2_URI);
Line 52:             }


Line 46:             boolean disableExternal = 
config.isAllowDisableExternalAuth() &&
Line 47:                     StringUtils.isEmpty(externalParamValue) ? false : 
"0".equals(externalParamValue);
Line 48:             if (config.isEnableExternalAuth() && !disableExternal) {
Line 49:                 response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_EXTERNAL_URI);
Line 50:             } else {
redirecting to ...
Line 51:                 response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_PHASE2_URI);
Line 52:             }
Line 53:         }
Line 54:     }


https://gerrit.ovirt.org/#/c/36119/47/backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase2Servlet.java
File 
backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase2Servlet.java:

Line 21:     protected void service(HttpServletRequest request, 
HttpServletResponse response)
Line 22:             throws ServletException, IOException {
Line 23:         SSOConfig config = (SSOConfig) 
request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG);
Line 24:         if (config.isEnableBasicAuth()) {
Line 25:             log.debug("Basic auth is enabled forwarding to 
BasicAuthServlet");
you can debug the SSOUtils.LOGIN_XXX so that messages will not be out of date.
Line 26:             response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_BASIC_URI);
Line 27:         } else {
Line 28:             log.debug("Basic auth is disabled forwarding to 
LoginPhase3Servlet");
Line 29:             response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_PHASE3_URI);


https://gerrit.ovirt.org/#/c/36119/47/backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase3Servlet.java
File 
backend/manager/modules/enginesso/src/main/java/org/ovirt/engine/core/sso/servlets/LoginPhase3Servlet.java:

Line 28:     private static Logger log = 
LoggerFactory.getLogger(LoginPhase3Servlet.class);
Line 29: 
Line 30:     @Override
Line 31:     protected void service(HttpServletRequest request, 
HttpServletResponse response)
Line 32:             throws ServletException, IOException {
enter and debug isUserAuthenticated
Line 33:         HttpSession session = request.getSession(true);
Line 34:         Credentials userCredentials = null;
Line 35:         try {
Line 36:             if (SSOUtils.isUserAuthenticated(session)) {


Line 42:             if (userCredentials != null) {
Line 43:                 log.error("Cannot authenticate user '{}' {}", 
userCredentials.getUsername(), ex.getMessage());
Line 44:                 log.debug("Cannot authenticate user '{}'", 
userCredentials.getUsername(), ex);
Line 45:             }
Line 46:             request.getSession(true).setAttribute(SSOUtils.LOGIN_MSG, 
ex.getMessage());
debug redirecting to... the message
Line 47:             response.sendRedirect(request.getContextPath() + 
SSOUtils.LOGIN_FORM_URI);
Line 48:         } finally {
Line 49:             
request.getSession().removeAttribute(SSOUtils.USER_CREDENTIALS);
Line 50:         }


-- 
To view, visit https://gerrit.ovirt.org/36119
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4894fc12653027271b6abd4dd5313b10593703fa
Gerrit-PatchSet: 47
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to