
<%--
   Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
--%>
<%@ page language="java"  %>

<%
    String inSessionUser = ((null != request.getUserPrincipal()) ? request.getUserPrincipal().getName() : null);
    String authMode = request.getAuthType();
   
   
%>
<!DOCTYPE html>

<html>
    <head>
      <style type="text/css">
           

           h2, h3 {
                text-decoration: underline;
            }


            #menu li {
                cursor: pointer;
            }

            #menu a:hover {
                background-color: rgb(105, 136, 203);;
            }
            p {
                width : 500px;
            }

           
        </style>
        <title> Who am I?</title>
    </head>
    <body>
    
     <pre>
    <%
   
//     try{
//     throw new Exception("test");
//    } catch(Exception e) {
//        e.printStackTrace(new java.io.PrintWriter(out, true));
//    
//    }
    %>
    </pre>
        <h2>Who am I?</h2>

        <h4>Authenticated app user: <%=(inSessionUser == null ? "Anonymous" : inSessionUser)%></h4>
        <h4>Mode:<%=(authMode == null ? "Not authenticated" : authMode)%></h4>
       
       
        
        <%
        if (inSessionUser == null) {
        %>
        <p>
           <a href="/sso-partially-secured/secured/whoami.jsp">login</a>
         </p>
        
        <%
        } else {
        
        %>
          <p>
           <a href="/sso-fully-secured">Got to logout page</a>
         </p>
        <%
        }
        %>
        
         <h3>Default - Perimeter Security</h3>
         
         <p>
           <a href="/sso-perimeter-security">login</a>
         </p>
         
         <h3>Fully SSO secured</h3>
         <p>
           <a href="/sso-fully-secured">login</a>
         </p>
         
         <h3>Partially SSO secured</h3>
          <p>
           <a href="/sso-partially-secured/secured/whoami.jsp">login</a>
         </p>
         <p>
           <a href="/sso-partially-secured/unsecured/whoami.jsp">click and see who I am</a>
         </p>
         
         <h3>Public - Application not secured by SSO</h3>
          <p>
           <a href="/sso-unsecured">public page</a>
         </p>
         
         
    </body>
</html>