Skip to content

Commit

Permalink
add skipKerberos=true to script callback
Browse files Browse the repository at this point in the history
  • Loading branch information
maximthomas committed Dec 10, 2020
1 parent 095e9cb commit eda8dd4
Show file tree
Hide file tree
Showing 10 changed files with 275 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ protected void getLoginDisplay() throws Exception {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof HttpCallback) {
processHttpCallback((HttpCallback)callbacks[i]);
return;
//return;
} else if (callbacks[i] instanceof RedirectCallback) {
processRedirectCallback((RedirectCallback)callbacks[i]);
return;
Expand Down Expand Up @@ -1108,10 +1108,11 @@ private void processHttpCallback(HttpCallback hc) throws Exception{
", code: " + hc.getNegotiationCode());
}

forward = false;
//forward = false;
response.setHeader(hc.getNegotiationHeaderName(),
hc.getNegotiationHeaderValue());
response.sendError(hc.getNegotiationCode());
response.setStatus(hc.getNegotiationCode());
//response.sendError();
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<%--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
The contents of this file are subject to the terms
of the Common Development and Distribution License
(the License). You may not use this file except in
compliance with the License.
You can obtain a copy of the License at
https://opensso.dev.java.net/public/CDDLv1.0.html or
opensso/legal/CDDLv1.0.txt
See the License for the specific language governing
permission and limitations under the License.
When distributing Covered Code, include this CDDL
Header Notice in each file and include the License file
at opensso/legal/CDDLv1.0.txt.
If applicable, add the following below the CDDL Header,
with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: Login.jsp,v 1.11 2009/01/09 07:13:21 bhavnab Exp $
Portions Copyrighted 2012-2015 ForgeRock AS.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<%@page info="Login" language="java"%>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
<%@taglib uri="/WEB-INF/auth.tld" prefix="auth"%>
<jato:useViewBean className="com.sun.identity.authentication.UI.LoginViewBean">
<%@page contentType="text/html" %>
<%@ page import = "org.owasp.esapi.ESAPI" %>
<head>
<title><jato:text name="htmlTitle_Login" /></title>
<%
String ServiceURI = (String) viewBean.getDisplayFieldValue(viewBean.SERVICE_URI);
String encoded = "false";
String gotoURL = (String) viewBean.getValidatedInputURL(
request.getParameter("goto"), request.getParameter("encoded"), request);
String gotoOnFailURL = (String) viewBean.getValidatedInputURL(
request.getParameter("gotoOnFail"), request.getParameter("encoded"), request);
String encodedQueryParams = (String) viewBean.getEncodedQueryParams(request);
if ((gotoURL != null) && (gotoURL.length() != 0)) {
encoded = "true";
}
%>

<jato:content name="validContent">
<script language="JavaScript" type="text/javascript">
<!--
var defaultBtn = 'Submit';
var elmCount = 0;
/**
* submit form with given button value
*
* @param value of button
*/
function LoginSubmit(value) {
aggSubmit();
var hiddenFrm = document.forms['Login'];
if (hiddenFrm != null) {
hiddenFrm.elements['IDButton'].value = value;
if (this.submitted) {
alert("The request is currently being processed");
}
else {
this.submitted = true;
hiddenFrm.submit();
}
}
}
-->
</script>
</jato:content>
</head>
<body onload="placeCursorOnFirstElm();">
<jato:content name="validContent">
<auth:form name="Login" method="post" defaultCommandChild="DefaultLoginURL">
<jato:tiledView name="tiledCallbacks"
type="com.sun.identity.authentication.UI.CallBackTiledView">

<script language="javascript" type="text/javascript">
<!--
elmCount++;
-->
</script>

<jato:content name="textOut">

<script language="javascript" type="text/javascript">
<!--
<jato:text name="scriptContent" defaultValue="" escape="false"/>
-->
</script>
<div class="TextOutputCallback_<jato:text name="messageType" />"><jato:text name="textContent" defaultValue="" escape="false" /></div>

</jato:content>

<jato:content name="textBox">
<div class="row">
<label for="IDToken<jato:text name="txtIndex" />">
<jato:text name="txtPrompt" defaultValue="User name:" escape="false" />
<jato:content name="isRequired">
<img src="<%= ServiceURI %>/images/required.gif" alt="Required Field"
title="Required Field" width="7" height="14" />
</jato:content>
</label>
<input class="textbox" type="text" name="IDToken<jato:text name="txtIndex" />" id="IDToken<jato:text name="txtIndex" />" value="<jato:text name="txtValue" />" />
</div>
</jato:content>
<jato:content name="hiddenValueBox">
<input class="hiddenValueBox" type="hidden" name="<jato:text name="txtId" />" id="<jato:text name="txtId" />" value="<jato:text name="txtValue" />" />
</jato:content>
<jato:content name="password">
<div class="row">
<label for="IDToken<jato:text name="txtIndex" />">
<jato:text name="txtPrompt" defaultValue="Password:" escape="false" />
<jato:content name="isRequired">
<img src="<%= ServiceURI %>/images/required.gif" alt="Required Field"
title="Required Field" width="7" height="14" />
</jato:content>
</label>
<input class="textbox" type="password" name="IDToken<jato:text name="txtIndex" />" id="IDToken<jato:text name="txtIndex" />" value="" />
</div>
</jato:content>
<jato:content name="choice">
<div class="row">
<label for="IDToken<jato:text name="txtIndex" />">
<jato:text name="txtPrompt" defaultValue="RadioButton:" escape="false" />
<jato:content name="isRequired">
<img src="<%= ServiceURI %>/images/required.gif" alt="Required Field"
title="Required Field" width="7" height="14" />
</jato:content>
</label>
<div class="radios">
<jato:tiledView name="tiledChoices" type="com.sun.identity.authentication.UI.CallBackChoiceTiledView">
<jato:content name="selectedChoice">
<input type="radio" name="IDToken<jato:text name="txtParentIndex" />" id="IDToken<jato:text name="txtIndex" />" value="<jato:text name="txtIndex" />" checked="checked" />
<label for="IDToken<jato:text name="txtIndex" />">
<jato:text name="txtChoice" />
</label>
</jato:content>

<jato:content name="unselectedChoice">
<input type="radio" name="IDToken<jato:text name="txtParentIndex" />" id="IDToken<jato:text name="txtIndex" />" value="<jato:text name="txtIndex" />" />
<label for="IDToken<jato:text name="txtIndex" />">
<jato:text name="txtChoice" />
</label>
</jato:content>
</jato:tiledView>
</div>
</div>
</jato:content>
</jato:tiledView>

<jato:content name="ContentStaticTextResult">
<!-- after login output message -->
<p><b><jato:getDisplayFieldValue name='StaticTextResult'
defaultValue='' fireDisplayEvents='true' escape='false'/></b></p>
</jato:content>
<jato:content name="ContentHref">
<!-- URL back to Login page -->
<p><auth:href name="LoginURL" fireDisplayEvents='true'>
<jato:text name="txtGotoLoginAfterFail" /></auth:href></p>
</jato:content>
<jato:content name="ContentImage">
<!-- customized image defined in properties file -->
<p><img name="IDImage" src="<jato:getDisplayFieldValue name='Image'/>" alt=""/></p>
</jato:content>

<jato:content name="ContentButtonLogin">
<fieldset>
<jato:content name="hasButton">
<div class="row">
<jato:tiledView name="tiledButtons"
type="com.sun.identity.authentication.UI.ButtonTiledView">
<input name="Login.Submit" type="button" onclick="LoginSubmit('<jato:text name="txtButton" />'); return false;" class="button" value="<jato:text name="txtButton" />" />
</jato:tiledView>
</div>
<script language="javascript" type="text/javascript">
<!--
defaultBtn = '<jato:text name="defaultBtn" />';
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i ++) {
if (inputs[i].type == 'button' && inputs[i].value == defaultBtn) {
inputs[i].setAttribute("class", "button primary");;
break;
}
}
-->
</script>
</jato:content>
<jato:content name="hasNoButton">
<div class="row">
<input name="Login.Submit" type="submit" onclick="LoginSubmit('<jato:text name="lblSubmit" />'); return false;" class="button primary" value="<jato:text name="lblSubmit" />" />
</div>
</jato:content>
</fieldset>
</jato:content>

</auth:form>
</jato:content>
</div>
</div>
</div>
</div>
</body>
</jato:useViewBean>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@


<ModuleProperties moduleName="WindowsDesktopSSO" version="1.0" >
<Callbacks length="1" order="1" timeout="120" header="This server uses WindowsDesktopSSO Authentication" >
<Callbacks length="2" order="1" timeout="120" header="This server uses WindowsDesktopSSO Authentication" template="WindowsDesktopSSO.jsp" >
<HttpCallback>
<HttpHeader>Authorization</HttpHeader>
<Negotiation>WWW-Authenticate:Negotiate</Negotiation>
<HttpErrorCode>401</HttpErrorCode>
</HttpCallback>
<TextOutputCallback messageType="script"><![CDATA[
var p = new URLSearchParams(window.location.search);
p.set('skipKerberos', 'true');
window.location.search = p.toString();
]]></TextOutputCallback>
</Callbacks>
</ModuleProperties>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: WindowsDesktopSSO.xml,v 1.9 2009/07/16 04:12:00 cbasha Exp $
$Id: WindowsDesktopSSO.xml,v 1.3 2008/06/25 05:44:57 qcheng Exp $
-->

Expand All @@ -32,11 +32,16 @@


<ModuleProperties moduleName="WindowsDesktopSSO" version="1.0" >
<Callbacks length="1" order="1" timeout="120" header="Auf diesem Server kommt die WindowsDesktopSSO-Authentifizierung zum Einsatz." >
<Callbacks length="2" order="1" timeout="120" header="This server uses WindowsDesktopSSO Authentication" template="WindowsDesktopSSO.jsp" >
<HttpCallback>
<HttpHeader>Authorization</HttpHeader>
<Negotiation>WWW-Authenticate:Negotiate</Negotiation>
<HttpErrorCode>401</HttpErrorCode>
</HttpCallback>
<TextOutputCallback messageType="script"><![CDATA[
var p = new URLSearchParams(window.location.search);
p.set('skipKerberos', 'true');
window.location.search = p.toString();
]]></TextOutputCallback>
</Callbacks>
</ModuleProperties>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: WindowsDesktopSSO.xml,v 1.9 2009/07/16 04:12:01 cbasha Exp $
$Id: WindowsDesktopSSO.xml,v 1.3 2008/06/25 05:44:57 qcheng Exp $
-->

Expand All @@ -32,11 +32,16 @@


<ModuleProperties moduleName="WindowsDesktopSSO" version="1.0" >
<Callbacks length="1" order="1" timeout="120" header="Este servidor utiliza la autenticación de WindowsDesktopSSO." >
<Callbacks length="2" order="1" timeout="120" header="This server uses WindowsDesktopSSO Authentication" template="WindowsDesktopSSO.jsp" >
<HttpCallback>
<HttpHeader>Authorization</HttpHeader>
<Negotiation>WWW-Authenticate:Negotiate</Negotiation>
<HttpErrorCode>401</HttpErrorCode>
</HttpCallback>
<TextOutputCallback messageType="script"><![CDATA[
var p = new URLSearchParams(window.location.search);
p.set('skipKerberos', 'true');
window.location.search = p.toString();
]]></TextOutputCallback>
</Callbacks>
</ModuleProperties>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: WindowsDesktopSSO.xml,v 1.9 2009/07/16 04:12:01 cbasha Exp $
$Id: WindowsDesktopSSO.xml,v 1.3 2008/06/25 05:44:57 qcheng Exp $
-->

Expand All @@ -32,11 +32,16 @@


<ModuleProperties moduleName="WindowsDesktopSSO" version="1.0" >
<Callbacks length="1" order="1" timeout="120" header="Ce serveur utilise l&apos;authentification WindowsDesktopSSO." >
<Callbacks length="2" order="1" timeout="120" header="This server uses WindowsDesktopSSO Authentication" template="WindowsDesktopSSO.jsp" >
<HttpCallback>
<HttpHeader>Authorization</HttpHeader>
<Negotiation>WWW-Authenticate:Negotiate</Negotiation>
<HttpErrorCode>401</HttpErrorCode>
</HttpCallback>
<TextOutputCallback messageType="script"><![CDATA[
var p = new URLSearchParams(window.location.search);
p.set('skipKerberos', 'true');
window.location.search = p.toString();
]]></TextOutputCallback>
</Callbacks>
</ModuleProperties>
Loading

0 comments on commit eda8dd4

Please sign in to comment.