[java-identity-provider] 13/28: Fix call to deprecated method.

Scott Cantor cantor.2 at osu.edu
Wed Jan 31 14:51:59 UTC 2024


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch dev/thymeleaf
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=797a3082dc2e8e6db1d2d21e9f248fe95b56dea5

commit 797a3082dc2e8e6db1d2d21e9f248fe95b56dea5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Dec 19 12:01:03 2023 -0500

    Fix call to deprecated method.
---
 .../net/shibboleth/idp/module/views/login.vm       | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/views/login.vm b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/views/login.vm
new file mode 100644
index 000000000..857422dc7
--- /dev/null
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/module/views/login.vm
@@ -0,0 +1,109 @@
+##
+## 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
+## encoder - HTMLEncoder class
+## cspDigester - Calculates base64-encoded SHA-2 hashes (call apply)
+## cspNonce - Calculates secure nonces (call generateIdentifier)
+## request - HttpServletRequest
+## response - HttpServletResponse
+## environment - Spring Environment object for property resolution
+## custom - arbitrary object injected by deployer
+##
+#set ($rpContext = $profileRequestContext.getSubcontext('net.shibboleth.profile.context.RelyingPartyContext'))
+#set ($username = $authenticationContext.ensureSubcontext('net.shibboleth.idp.authn.context.UsernamePasswordContext').getUsername())
+##
+#set ($onClick = "this.childNodes[0].nodeValue='#springMessageText('idp.login.pleasewait', 'Logging in, please wait...')'")
+$response.addHeader("Content-Security-Policy", "script-src-attr 'unsafe-hashes' 'sha256-$cspDigester.apply($onClick)'")
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>#springMessageText("idp.title", "Web Login Service")</title>
+        <meta charset="UTF-8" />
+        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
+        <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("idp.css", "/css/placeholder.css")">
+    </head>
+    <body>
+        <main class="main">
+            <header>
+                <img class="main-logo" src="$request.getContextPath()#springMessageText("idp.logo", "/images/placeholder-logo.png")" alt="#springMessageText("idp.logo.alt-text", "logo")" />
+                
+                #set ($serviceName = $rpUIContext.serviceName)
+                #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
+                    <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
+                #end
+            </header>
+            
+            <section>
+                <form action="$flowExecutionUrl" method="post">
+                    #parse("csrf/csrf.vm")
+
+                    #*
+                    //
+                    //    SP Description & Logo (optional)
+                    //    These idpui lines will display added information (if available
+                    //    in the metadata) about the Service Provider (SP) that requested
+                    //    authentication. These idpui lines are "active" in this example
+                    //    (not commented out) - this extra SP info will be displayed.
+                    //    Remove or comment out these lines to stop the display of the
+                    //    added SP information.
+                    //
+                    *#
+                    #set ($logo = $rpUIContext.getLogo())
+                    #if ($logo)
+                        <img class="service-logo" src= "$encoder.encodeForHTMLAttribute($logo)" alt="$encoder.encodeForHTMLAttribute($serviceName)">
+                    #end
+                    #set ($desc = $rpUIContext.getServiceDescription())
+                    #if ($desc)
+                        <p>$encoder.encodeForHTML($desc)</p>
+                    #end
+                            
+                    #parse("login-error.vm")
+
+                    <label for="username">#springMessageText("idp.login.username", "Username")</label>
+                    <input id="username" name="j_username" type="text"
+                        value="#if($username)$encoder.encodeForHTML($username)#end" />
+                        
+                    <label for="password">#springMessageText("idp.login.password", "Password")</label>
+                    <input type="password" name="j_password" id="password" value="" />
+    
+                    ## You may need to modify this to taste, such as changing the flow name checked to authn/MFA.
+                    #if (!$authenticationContext.getActiveResults().containsKey('authn/Password'))
+                        <input type="checkbox" name="donotcache" value="1" id="donotcache" />
+                        <label for="donotcache">#springMessageText("idp.login.donotcache", "Don't Remember Login")</label>
+                    #end
+    
+                    <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 class="grid">
+                        <div class="grid-item">
+                            <button type="submit" name="_eventId_proceed" onClick="$onClick"
+                                >#springMessageText("idp.login.login", "Login")</button>
+                        </div>
+                    </div>
+                </form>
+    
+                <ul>
+                    <li><a href="#springMessageText("idp.url.password.reset", '#')">#springMessageText("idp.login.forgotPassword", "Forgot your password?")</a></li>
+                    <li><a href="#springMessageText("idp.url.helpdesk", '#')">#springMessageText("idp.login.needHelp", "Need Help?")</a></li>
+                </ul>
+            </section>
+        </main>
+        <footer class="footer">
+            <div class="cc">
+                <p>#springMessageText("idp.footer", "Insert your footer text here.")</p>
+            </div>
+        </footer>
+     </body>
+</html>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list