diff options
Diffstat (limited to 'idp/templates/views')
| -rw-r--r-- | idp/templates/views/layout.vm | 32 | ||||
| -rw-r--r-- | idp/templates/views/login.vm | 116 |
2 files changed, 148 insertions, 0 deletions
diff --git a/idp/templates/views/layout.vm b/idp/templates/views/layout.vm new file mode 100644 index 0000000..7dca3b5 --- /dev/null +++ b/idp/templates/views/layout.vm @@ -0,0 +1,32 @@ +#macro(layout) +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1.0"> + <title>$title - $titleSuffix</title> + <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/main.css"> + </head> + + <body> + <div class="wrapper"> + <div class="container"> + <header> + <img src="$request.getContextPath()#springMessage("idp.logo")" alt="#springMessageText("idp.logo.alt-text", "logo")"> + #if ($titleSuffix) + <h3>#springMessageText("idp.title", "Web Login Service") - $titleSuffix</h3> + #end + </header> + <div class="content"> + $!bodyContent + </div> + </div> + <footer> + <div class="contatiner container-footer"> + <p class="footer-text">#springMessageText("idp.footer", "Your footer here.")</p> + </div> + </footer> + </div> + </body> +</html> +#end diff --git a/idp/templates/views/login.vm b/idp/templates/views/login.vm new file mode 100644 index 0000000..b4f02d0 --- /dev/null +++ b/idp/templates/views/login.vm @@ -0,0 +1,116 @@ +## +## 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 +## +#parse("layout.vm") + +#@layout() + <div class="column one"> + #parse("login-error.vm") + + <form action="$flowExecutionUrl" method="post"> + + #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-element-wrapper"> + <label for="username">#springMessageText("idp.login.username", "Username")</label> + <input class="form-element form-field" id="username" name="j_username" type="text" + value="#if($username)$encoder.encodeForHTML($username)#end"> + </div> + + <div class="form-element-wrapper"> + <label for="password">#springMessageText("idp.login.password", "Password")</label> + <input class="form-element form-field" id="password" name="j_password" type="password" value=""> + </div> + + <div class="form-element-wrapper"> + <input type="checkbox" name="donotcache" value="1" id="donotcache"> + <label for="donotcache">#springMessageText("idp.login.donotcache", "Don't Remember Login")</label> + </div> + #end + + <div class="form-element-wrapper"> + <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-element-wrapper"> + <button class="form-element form-button" 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-element-wrapper"> + <button class="form-element form-button" type="submit" name="_eventId_$extFlow.getId()"> + #springMessageText("idp.login.$extFlow.getId().replace('authn/','')", $extFlow.getId().replace('authn/','')) + </button> + </div> + #end + #end + </form> + + #* + // + // 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 src= "$encoder.encodeForHTMLAttribute($logo)" + alt="$encoder.encodeForHTMLAttribute($serviceName)"> + #end + #set ($desc = $rpUIContext.getServiceDescription()) + #if ($desc) + $encoder.encodeForHTML($desc) + #end + + </div> + <div class="column two"> + <ul class="list list-help"> + #if ($passwordEnabled) + <li class="list-help-item"><a href="#springMessageText("idp.url.password.reset", "#")"><span class="item-marker">›</span> #springMessageText("idp.login.forgotPassword", "Forgot your password?")</a></li> + #end + <li class="list-help-item"><a href="#springMessageText("idp.url.helpdesk", "#")"><span class="item-marker">›</span> #springMessageText("idp.login.needHelp", "Need Help?")</a></li> + </ul> + </div> +#end |
