-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.vm
220 lines (203 loc) · 11.7 KB
/
login.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
##
## Velocity Template for DisplayUsernamePasswordPage view-state
##
## Velocity context will contain the following properties
## flowExecutionUrl - the form action location
## flowRequestContext - the Spring Web Flow RequestContext
## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl)
## profileRequestContext - root of context tree
## authenticationContext - context with authentication request information
## authenticationErrorContext - context with login error state
## authenticationWarningContext - context with login warning state
## ldapResponseContext - context with LDAP state (if using native LDAP)
## rpUIContext - the context with SP UI information from the metadata
## extendedAuthenticationFlows - collection of "extended" AuthenticationFlowDescriptor objects
## passwordPrincipals - contents of the shibboleth.authn.Password.PrincipalOverride bean
## encoder - HTMLEncoder class
## request - HttpServletRequest
## response - HttpServletResponse
## environment - Spring Environment object for property resolution
## custom - arbitrary object injected by deployer
##
#set ($rpContext = $profileRequestContext.getSubcontext('net.shibboleth.idp.profile.context.RelyingPartyContext'))
#set ($username = $authenticationContext.getSubcontext('net.shibboleth.idp.authn.context.UsernamePasswordContext', true).getUsername())
#set ($passwordEnabled = false)
#if (!$passwordPrincipals or $passwordPrincipals.isEmpty() or $authenticationContext.isAcceptable($passwordPrincipals))
#set ($passwordEnabled = true)
#end
##
<!DOCTYPE html>
<html>
<head>
#parse("bi_head_css_js.vm")
<!-- Page details -->
<title>#springMessageText("idp.title", "Web Login Service")</title>
<!-- Extra CSS/Javascript -->
</head>
<body>
<!-- Bootstrap Italia header wrapper -->
#parse("bi_header_wrapper.vm")
<div class="main-body">
<div class="container">
<h2 class="mt-5 px-4 px-md-0">
#springMessageText("idp.title", "Web Login Service")
</h2>
<div class="row">
<div class="col-md-5 pt-5 pb-2 py-md-5 px-4 px-md-0 bd-content">
<div class="content">
<div class="column one">
#parse("login-error.vm")
<form action="$flowExecutionUrl"
method="post"
class="needs-validation"
novalidate>
#parse("csrf/csrf.vm")
#set ($serviceName = $rpUIContext.serviceName)
#if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
<legend>
#springMessageText("idp.login.loginTo", "Login to")
$encoder.encodeForHTML($serviceName)
</legend>
#end
#if ($passwordEnabled)
<div class="form-group">
<input class="form-control"
id="username"
name="j_username"
type="text"
value="#if($username)$encoder.encodeForHTML($username)#end"
required>
<label for="username">
#springMessageText("idp.login.username",
"Username")
</label>
<div class="valid-feedback">
Validato!
</div>
<div class="invalid-feedback">
Per favore inserisci lo username
</div>
</div>
<div class="form-group">
<input class="form-control input-password"
id="password"
name="j_password"
type="password"
value=""
required>
<span class="password-icon" aria-hidden="true">
<svg class="password-icon-visible icon icon-sm">
<use xlink:href="$request.getContextPath()/bootstrap-italia/svg/sprite.svg#it-password-visible"></use>
</svg>
<svg class="password-icon-invisible icon icon-sm d-none">
<use xlink:href="$request.getContextPath()/bootstrap-italia/svg/sprite.svg#it-password-invisible"></use>
</svg>
</span>
<label for="password">
#springMessageText("idp.login.password",
"Password")
</label>
<div class="valid-feedback">
Validato!
</div>
<div class="invalid-feedback">
Per favore inserisci la password
</div>
</div>
## You may need to modify this to taste, such as changing the flow name its checking for to authn/MFA.
#if (!$authenticationContext.getActiveResults().containsKey('authn/Password'))
<div class="form-check">
<input type="checkbox"
name="donotcache"
value="1"
id="donotcache">
<label for="donotcache">#springMessageText("idp.login.donotcache", "Don't Remember Login")</label>
</div>
#end
#end
<div class="form-check">
<input id="_shib_idp_revokeConsent"
type="checkbox"
name="_shib_idp_revokeConsent"
value="true">
<label for="_shib_idp_revokeConsent">
#springMessageText("idp.attribute-release.revoke",
"Clear prior granting of permission
for release of your information
to this service.")
</label>
</div>
#if ($passwordEnabled)
<div class="form-group mt-4">
<button class="btn btn-primary"
type="submit"
name="_eventId_proceed"
onClick="this.childNodes[0].nodeValue='#springMessageText("idp.login.pleasewait", "Logging in, please wait...")'">
#springMessageText("idp.login.login", "Login")
</button>
</div>
#end
#foreach ($extFlow in $extendedAuthenticationFlows)
#if ($authenticationContext.isAcceptable($extFlow) and $extFlow.apply(profileRequestContext))
<div class="form-group">
<button class="btn btn-secondary"
type="submit"
name="_eventId_$extFlow.getId()">
#springMessageText("idp.login.$extFlow.getId().replace('authn/','')",
$extFlow.getId().replace('authn/',''))
</button>
</div>
#end
#end
</form>
</div>
<div class="column two mt-4">
<ul class="list list-help">
#if ($passwordEnabled)
<li class="list-help-item">
<a href="#springMessageText("idp.url.password.reset", "#")">
#springMessageText("idp.login.forgotPassword",
"Forgot your password?")
</a>
</li>
#end
<li class="list-help-item">
<a href="#springMessageText("idp.url.helpdesk", "#")">
#springMessageText("idp.login.needHelp", "Need Help?")
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-md-5 py-3 py-md-5 px-4 px-md-0 bd-content offset-md-2">
<!-- Info Box -->
#parse("bi_info_box.vm")
</div>
</div>
</div>
</div>
<!-- Bootstrap Italia footer -->
#parse("bi_footer.vm")
<!-- Bootstrap Italia bottom scripts -->
#parse("bi_bottom_scripts.vm")
<!-- Bootstrap Italia validation script -->
<script>
(function() {
'use strict';
window.addEventListener('load', function() {
var forms = document.getElementsByClassName('needs-validation');
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
}, false);
form.classList.add('was-validated');
});
}, false);
})();
</script>
</body>
</html>