provide generic login form with link to OIDC authentication
This commit is contained in:
parent
4bf3cde5fb
commit
6c1ec7e2cc
2 changed files with 71 additions and 0 deletions
59
loops/server/loginform.pt
Normal file
59
loops/server/loginform.pt
Normal file
|
@ -0,0 +1,59 @@
|
|||
<html metal:use-macro="context/@@standard_macros/page"
|
||||
i18n:domain="zope">
|
||||
<head>
|
||||
<title metal:fill-slot="title" i18n:translate="">
|
||||
Sign in
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<metal:slot fill-slot="logo"><img
|
||||
tal:attributes="src context/++resource++zope3logo.gif" />
|
||||
</metal:slot>
|
||||
|
||||
<metal:ignore fill-slot="navigators" />
|
||||
|
||||
<metal:empty fill-slot="breadcrumbs">
|
||||
<br />
|
||||
</metal:empty>
|
||||
|
||||
<div metal:fill-slot="body" tal:define="principal python:request.principal.id">
|
||||
<p i18n:translate="" tal:condition="python: principal == 'zope.anybody'">
|
||||
Please provide Login Information</p>
|
||||
<p i18n:translate="" tal:condition="python: principal != 'zope.anybody'">
|
||||
You are not authorized to perform this action. However, you may login as a
|
||||
different user who is authorized.</p>
|
||||
<p><a href="/auth_login">Login with Zitadel</a></p>
|
||||
<form action="." method="post"
|
||||
tal:attributes="action request/URL">
|
||||
<div tal:omit-tag=""
|
||||
tal:condition="python:principal != 'zope.anybody' and 'SUBMIT' in request">
|
||||
<span tal:define="dummy python:
|
||||
request.response.redirect(request.get('camefrom') or request.URL[-1])" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="label" i18n:translate="">User Name</div>
|
||||
<div class="field">
|
||||
<input type="text" name="login"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="label" i18n:translate="">Password</div>
|
||||
<div class="field">
|
||||
<input type="password" name="password"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<input class="form-element" type="submit"
|
||||
name="SUBMIT" value="Log in" i18n:attributes="value login-button" />
|
||||
</div>
|
||||
<input type="hidden" name="camefrom"
|
||||
tal:attributes="value request/camefrom | nothing">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
12
loops/server/loginform.zcml
Normal file
12
loops/server/loginform.zcml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser">
|
||||
|
||||
<browser:page
|
||||
name="loginForm.html" for="*"
|
||||
template="loginform.pt"
|
||||
permission="zope.Public"
|
||||
layer="cybertools.browser.loops.Loops" />
|
||||
|
||||
</configure>
|
||||
|
Loading…
Add table
Reference in a new issue