Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pingntlm provider support for pre-authentication issue #794

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkg/provider/pingntlm/example/form-redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html>

<head>
<title>Submit Form</title>
<meta name="referrer" content="origin" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
</head>

<body onload="javascript:document.forms[0].submit()">
<noscript>
<p>
<strong>Note:</strong> Since your browser does not support JavaScript, you must press the Resume button once to proceed.
</p>
</noscript>
<form method="post" action="https://authenticator.pingone.com/pingid/ppm/auth">
<input type="hidden" name="idp_account_id" value="some-uuid" />
<input type="hidden" name="ppm_request" value="secret" />
<noscript><input type="submit" value="Resume"/></noscript>
</form>
</body>
</html>
113 changes: 113 additions & 0 deletions pkg/provider/pingntlm/example/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js no-touch iem7" lang="en"> <![endif]-->
<!--[if lt IE 7]><html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" xml:lang="en" id="ie6" class="no-js no-touch ie lt-ie12 lt-ie11 lt-ie10 lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" xml:lang="en" id="ie7" class="no-js no-touch ie lt-ie12 lt-ie11 lt-ie10 lt-ie9 lt-ie8 gt-ie6"><![endif]-->
<!--[if IE 8]><html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" xml:lang="en" id="ie8" class="no-js no-touch ie lt-ie12 lt-ie11 lt-ie10 lt-ie9 gt-ie6 gt-ie7"><![endif]-->
<!--[if IE 9]><html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" xml:lang="en" id="ie9" class="no-js no-touch ie lt-ie12 lt-ie11 lt-ie10 gt-ie8 gt-ie7 gt-ie6"><![endif]-->
<!--[if !IE]><!-->
<!--
Ping Discovery Login
w/ Progressive Profiling
discovery.form.template.html
v3.0
-->
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" lang="en" xml:lang="en" class="no-touch no-js">
<!--<![endif]-->
<head>
<title>Login Page</title>
<!--[if lt IE 9]><meta http-equiv="X-UA-Compatible" content="IE=8" /><![endif]-->
<!--[if gt IE 8]><meta http-equiv="X-UA-Compatible" content="IE=edge" /><![endif]-->
<!--[if !IE]><meta http-equiv="X-UA-Compatible" content="chrome=1" /><![endif]-->
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
<meta http-equiv="cleartype" content="on">
<!-- Brought over from previous version of Login Page -->
<meta name="accessLevel" content="Guest" />
<meta name="country" content="US" />
<meta name="locale" content="US" />
<meta name="language" content="en" />
<meta name="title" content="Login Page" />
<script type="text/javascript" src="/etc/designs/cdc/clientlibs/responsive/js/foundation.js"></script>
<link rel="stylesheet" type="text/css" href="/etc/designs/cdc/clientlibs/responsive/css/login-federation.css">
</head>
<body id="wcq" class="fw-res cdc-login ping">
<div id="fw-overlay-spinner">
<div class="spinner-icon"></div>
<div id="fw-content" class="">
<div class="language">
<section id="fw-language-select">
<div class="dropdown-header" tabindex="5">United States - English</div>
<!-- default -->
<ul class="dropdown-content"></ul>
</section>
</div>
<header id="fw-masthead-temp" class=" cdc-landing" data-owner="ID">
<div id="fw-banner-temp">
<a id="fw-logo-temp" href="/c/en/us/index.html">
</a>
</div>
</header>
<div id="login-wrapper">
<article id="login">
<div class="title">
<section id="fw-title-nav-login">
<h1 class="pagetitle">Log in to your account</h1>
</section>
</div>
<div class="info-text">
<div class="close"><span tabindex="0"></span></div>
</div>
<form id="login-form" method="post" name="login-form" action="https://sso.example.com/idp/resumeSAML20/idp/startSSO.ping">
<ul>
<li id="containUser">
<label id="usernameLabel" for="userInput" class="username-label hint">Username or email</label>
<input id="userInput" class="" type="text" name="pf.username" value="" size="33" maxlength="105" autocomplete="off" autocorrect="off" autocapitalize="off" tabindex="1" />
<p class="msg idNull">We couldn't find that. Try again.</p>
</li>
<li id="containPass">
<label id="passwordLabel" for="passwordInput" class="password-label hint">Password</label>
<input id="passwordInput" class="" type="password" name="pf.pass" value="" size="33" maxlength="105" autocomplete="off" autocorrect="off" autocapitalize="off" tabindex="2" />
</li>
<input type="hidden" name="target" value="" />
</ul>
<!-- pass lookup values to/from ping -->
<input type="hidden" id="usertype" name="pf.userType" value="">
<input type="hidden" id="idpId" name="pf.idpId" value="">
<input type="hidden" id="isUserStale" name="pf.isUserStale" value="">
<input type="hidden" id="idpurl" name="pf.idpUrl" value="">
<input type="hidden" id="targetresource" name="pf.TargetResource" value="">
<input id="login-button" type="submit" name="login-button" value="Log in" tabindex="3" />
<span id="login-button-next" class="textholder">Next</span>
<span id="login-button-submit" class="textholder">Log in</span>
<input type="hidden" class="cancel" name="pf.cancel" value="" />
</form>
<div id="back-link"> <a href="">&lt; Back</a></div>
<div class="">
<aside id="register"></aside>
</div>
</article>
</div>
<div id="link-accounts-wrapper">
</div>
<div id="redirect-msg-wrapper">
</div>
<div id="create-cdc-wrapper">
</div>
<!-- pass lookup values to/from ping - post -->
<input type="hidden" id="link_idpurl" name="pf.idpUrl" value="">
</div>
</div>
<script type="text/javascript">
cdc = typeof cdc == "undefined" ? {} : cdc;
cdc.login = typeof cdc.login == "undefined" ? {} : cdc.login;
cdc.login.prefsObj = {
login_localize: true,
login_discovery: true
};
</script>
<script type="text/javascript" src="/etc/designs/cdc/clientlibs/responsive/js/login-federation.js"></script>
</body>
</html>
158 changes: 158 additions & 0 deletions pkg/provider/pingntlm/example/login2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
<title>Sign On</title>
<base href="https://id.example.com/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="x-ua-compatible" content="IE=edge">
<link rel="stylesheet" type="text/css" href="assets/css/main.css">
</head>

<body onload="setFocus()">

<div class="ping-container ping-signin">

<!--
if there is a logo present in the 'company-logo' container,
then 'has-logo' class should be added to 'ping-header' container.
-->
<div class="ping-header">
<span class="company-logo">
<!-- client company logo here -->
</span>
Sign On
</div>
<!-- .ping-header -->

<div class="ping-body-container">

<div>
<form method="POST" action="/idp/9ABjD/resumeSAML20/idp/startSSO.ping" autocomplete="off">
<div class="ping-messages">



</div>

<div class="ping-input-label">
Username
</div>
<div class="ping-input-container">
<input id="username" type="text" size="36" name="pf.username" value="" autocorrect="off" autocapitalize="off" onkeypress="return postOnReturn(event)">
<!---->
</div>

<div class="ping-input-label">
Password
</div>
<div class="ping-input-container">
<input id="password" type="password" size="36" name="pf.pass" onkeypress="return postOnReturn(event)">
</div>


<div class="ping-buttons">
<input type="hidden" name="pf.ok" value="">
<input type="hidden" name="pf.cancel" value="">

<a onclick="postOk();" class="ping-button normal allow" title="Sign On">
Sign On
</a>
</div>
<!-- .ping-buttons -->

<div class="ping-input-link ping-pass-change">
<a href="/idp/9ABjD/resumeSAML20/idp/startSSO.ping?ChangePassword=true" class="password-change">Change Password?</a>
</div>

<input type="hidden" name="pf.adapterId" id="pf.adapterId" value="VersentForm">
</form>
</div>
<!-- .ping-body -->
</div>
<!-- .ping-body-container -->

<div class="ping-footer-container">
<div class="ping-footer">
<div class="ping-credits"></div>
<div class="ping-copyright">Copyright © 2003-2017. Ping Identity Corporation. All rights reserved.</div>
</div>
<!-- .ping-footer -->
</div>
<!-- .ping-footer-container -->

</div>
<!-- .ping-container -->

<script type="text/javascript">

function getForgotPasswordUrl() {
var base = "https://id.example.com/ext/pwdreset/Identify?referrer=https%3A%2F%2Fid.example.com%2Fidp%2F9ABjD%2FresumeSAML20%2Fidp%2FstartSSO.ping&adapterId=ExampleForm";
window.location.href = base;
}

function postOk() {
document.forms[0]['pf.ok'].value = 'clicked';
document.forms[0].submit();
}
function postCancel() {
document.forms[0]['pf.cancel'].value = 'clicked';
document.forms[0].submit();
}
function postOnReturn(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13) {
document.forms[0].submit();
return false;
} else {
return true;
}
}
function setFocus() {
var platform = navigator.platform;
if (platform != null && platform.indexOf("iPhone") == -1) {
document.getElementById('username').focus();
}
}
function setMobile(mobile) {
var className = ' mobile',
hasClass = (bodyTag.className.indexOf(className) !== -1);

if (mobile && !hasClass) {
bodyTag.className += className;

} else if (!mobile && hasClass) {
bodyTag.className = bodyTag.className.replace(className, '');
}

}
function getScreenWidth() {
return (window.outerHeight) ? window.outerWidth : document.body.clientWidth;
}

var bodyTag = document.getElementsByTagName('body')[0],
width = getScreenWidth(),
remember = false && false;


if (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
setMobile(true);
} else {
setMobile((width <= 480));
window.onresize = function () {
width = getScreenWidth();
setMobile((width <= 480));
}
}
</script>



</body>

</html>
Loading
Loading