<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<title>E-Ident Demo App</title>
		<link rel="SHORTCUT ICON" href="/images/nets_favicon.png"/>
		<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
		<meta http-equiv="content-Type" content="text/html; charset=UTF-8"/>
		<meta http-equiv="Pragma" content="no-cache"/>
		<meta http-equiv="Cache-Control" content="no-cache"/>
		<link rel="stylesheet" type="text/css" href="/css/global.css"/>

		<script th:inline="javascript">
			var eidentPath = [[${homeUrl}]];
			window.history.pushState({}, '', eidentPath);
			
			// This method handles the scenario when a user clicks on browser back button from this page
			// On clicking back button, demo app front page is loaded rather than letting the control 
			//    to go to E-Ident service without any required parameters
			function registerPopstate() {
				window.onpopstate = function(event) {
					top.window.location.href=eidentPath;
				};
			}
		</script>
	</head>
	<body onload="setTimeout(registerPopstate, 10);"> <!-- making a delayed call to handle Safari browser (as it fires popstate event during page load) -->
		<div class="maintable">
			<img src="/images/nets.svg" alt="logo" class="nets_logo_status" width="20" height="30" hspace="0" vspace="0"/>
			<h4 class="header">Authenticated successfully</h4>
			<h5 class="claim">Returned claims:</h5>
			<div th:if="${oidc.pid} != null">
				<span class="claim-name">PID: <span class="claim-value" th:text="${oidc.pid}"></span></span>
			</div>
			<span class="claim-name">SubjectDN:<span class="claim-value" th:text="${oidc.subjectDN}"></span></span>
			<div th:if="${oidc.ssn} != null">
				<span class="claim-name">SSN:<span class="claim-value" th:text="${oidc.ssn}"></span></span>
			</div>
			<span class="claim-name">Authentication method:<span class="claim-value" th:text="${oidc.authmethod}"></span></span>
			<span class="claim-name">eID provider:<span class="claim-value" th:text="${oidc.providerID}"></span></span>
			<div th:if="${oidc.certPolicyOID} != null">
				<span class="claim-name">CertPolicyOID:<span class="claim-value" th:text="${oidc.certPolicyOID}"></span></span>
			</div>
			<div th:if="${oidc.dob} != null">
				<span class="claim-name">Date of birth<span class="claim-value" th:text="${oidc.dob}"></span></span>
			</div>
			<br/>
			
			<form>
				<h5 class="claim">Raw response:</h5>
				<textarea class="rawclaims" name="rawClaims" rows="34" th:text="${oidc.rawClaims}"></textarea>  <!-- cols="131"  -->
			</form>
			<br/>
		</div>
	</body>
</html>