
<%@ page import="java.io.*,java.util.*,javax.servlet.http.*" %>
<%@ page import="javax.servlet.*" %>
<%@ page import="jet.server.api.http.HttpUtil" %>
<%@ page import="jet.server.api.http.HttpUserSessionManager" %>
<%@ page import="jet.server.servlets.JRServlet" %>
<%@ page import="com.example.MyExternalAuthorized" %>

<html>
<head>
<title>Turn Off Single Sign On - Set HttpExternalAuthorized to Null</title>
</head>
<body>
<% 
    // This page registers a null valued for the HttpExternalAuthorized
    // class with JReport Server, turning off Single Sign On.
    //
    // It demonstrates how this can be done dynamically.
    //
    // This jsp page is intended to be linked to from 
    // the index page for setting up the state
    // of JReport Server before running the various
    // scenarios that show how Single Sign On works.
   
    HttpUtil.initEnv(System.getProperties());

    HttpUserSessionManager ssnMan = HttpUtil.getHttpRptServer().getHttpUserSessionManager();

    // Telling JReport Server to use a null valued instance of HttpExternalAuthorized
    // is how to unset the method and turn off Single Sign On.
    ssnMan.setHttpExternalAuthorized(null);

    // redirect back to the index page.
    // use action value to cause the browser to get a fresh copy of the page.
    long time= new Date().getTime();
%>
%<script language="javascript" type="text/javascript">
    location.replace('customIndex.jsp?action="<%=time %>"');
</script>
</body>
</html>

