aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/templates')
-rw-r--r--gn_auth/templates/admin/register-client.html109
-rw-r--r--gn_auth/templates/admin/view-oauth2-client.html136
-rw-r--r--gn_auth/templates/emails/forgot-password.html38
-rw-r--r--gn_auth/templates/emails/forgot-password.txt12
-rw-r--r--gn_auth/templates/oauth2/authorise-user.html14
-rw-r--r--gn_auth/templates/users/change-password.html52
-rw-r--r--gn_auth/templates/users/forgot-password-token-send-success.html22
-rw-r--r--gn_auth/templates/users/forgot-password.html38
-rw-r--r--gn_auth/templates/users/unverified-user.html148
9 files changed, 373 insertions, 196 deletions
diff --git a/gn_auth/templates/admin/register-client.html b/gn_auth/templates/admin/register-client.html
index 20d7aa2..bfe56f8 100644
--- a/gn_auth/templates/admin/register-client.html
+++ b/gn_auth/templates/admin/register-client.html
@@ -9,59 +9,72 @@
<form method="POST" action="{{url_for('oauth2.admin.register_client')}}">
- <fieldset>
- <legend>Select client scope</legend>
-
+ <legend>Select client scope</legend>
+ <div class="form-group">
{%for scp in scope%}
- <input name="scope[]" id="chk-{{scp}}"type="checkbox" value="{{scp}}"
- {%if scp=="profile"%}checked="checked"{%endif%} />
- <label for="chk-{{scp}}">{{scp}}</label><br />
+ <div class="checkbox">
+ <label for="chk-{{scp}}">
+ <input name="scope[]" id="chk-{{scp}}"type="checkbox" value="{{scp}}"
+ {%if scp=="profile"%}checked="checked"{%endif%} />
+ {{scp}}
+ </label>
+ </div>
{%endfor%}
+ </div>
- </fieldset>
-
- <fieldset>
- <legend>Basic OAuth2 client information</legend>
-
-
- <label for="txt-client-name">Client name</label>
- <input name="client_name" type="text" id="txt-client-name"
+ <legend>Basic OAuth2 client information</legend>
+ <div class="form-group">
+ <label for="txt-client-name" class="form-label">Client name</label>
+ <input name="client_name"
+ type="text"
+ id="txt-client-name"
+ class="form-control"
required="required" />
- <br /><br />
+ </div>
- <label for="txt-redirect-uri">Redirect URI</label>
- <input name="redirect_uri" type="text" id="txt-redirect-uri"
+ <div class="form-group">
+ <label for="txt-redirect-uri" class="form-label">Redirect URI</label>
+ <input name="redirect_uri"
+ type="text"
+ id="txt-redirect-uri"
+ class="form-control"
required="required" />
- <br /><br />
+ </div>
- <label for="txt-other-redirect-uris">
- Other redirect URIs (Enter one URI per line)</label>
- <br />
- <textarea name="other_redirect_uris" id="txt-other-redirect-uris"
+ <div class="form-group">
+ <label for="txt-other-redirect-uris" class="form-label">
+ Other redirect URIs</label>
+ <div class="form-text text-muted">Enter one URI per line</div>
+ <textarea name="other_redirect_uris"
+ id="txt-other-redirect-uris"
cols="80" rows="10"
+ class="form-control"
title="Enter one URI per line."></textarea>
- <br /><br />
- <fieldset>
- <legend>Supported grant types</legend>
- {%for granttype in granttypes%}
- <input name="grants[]"
- type="checkbox"
- value="{{granttype.value}}"
- id="chk-{{granttype.name.lower().replace(' ', '-')}}"
- checked="checked" />
+ </div>
+
+ <div class="form-group">
+ <legend>Supported grant types</legend>
+ {%for granttype in granttypes%}
+ <div class="checkbox">
<label for="chk-{{granttype.name.lower().replace(' ', '-')}}">
+ <input name="grants[]"
+ type="checkbox"
+ value="{{granttype.value}}"
+ id="chk-{{granttype.name.lower().replace(' ', '-')}}"
+ checked="checked" />
{{granttype.name}}
</label>
- <br /><br />
- {%endfor%}
- </fieldset>
- </fieldset>
-
- <fieldset>
- <legend>User information</legend>
+ </div>
+ {%endfor%}
+ </div>
- <p>The user to register this client for</p>
- <select name="user" required="required">
+ <legend>User information</legend>
+ <div class="form-group">
+ <label for="select-user">The user to register this client for</label>
+ <select id="select-user"
+ name="user"
+ class="form-control"
+ required="required">
{%for user in users%}
<option value="{{user.user_id}}"
{%if user.user_id==current_user.user_id%}
@@ -69,8 +82,18 @@
{%endif%}>{{user.name}} ({{user.email}})</option>
{%endfor%}
</select>
- </fieldset>
-
- <input type="submit" value="register client" />
+ </div>
+
+ <legend>Other metadata</legend>
+ <div class="form-group">
+ <label class="form-group" for="txt-client-jwk-uri">
+ Client's Public JWKs</label>
+ <input type="text"
+ id="txt-client-jwk-uri"
+ name="client_jwk_uri"
+ class="form-control" />
+ </div>
+
+ <input type="submit" value="register client" class="btn btn-primary" />
</form>
{%endblock%}
diff --git a/gn_auth/templates/admin/view-oauth2-client.html b/gn_auth/templates/admin/view-oauth2-client.html
index 415873d..c250ee3 100644
--- a/gn_auth/templates/admin/view-oauth2-client.html
+++ b/gn_auth/templates/admin/view-oauth2-client.html
@@ -13,118 +13,82 @@
{%set client = client.value%}
<form method="POST" action="{{url_for('oauth2.admin.edit_client')}}">
<legend>View/Edit Oauth2 Client</legend>
+
<input type="hidden" name="client_id" value="{{client.client_id}}" />
<input type="hidden" name="client_name" value="{{client.client_metadata.client_name}}" />
+
<div>
- <p><strong>Client ID: <strong> {{client.client_id}}</p>
- <p><strong>Client Name: <strong> {{client.client_metadata.client_name}}</p>
+ <p><strong>Client ID: </strong> {{client.client_id}}</p>
+ <p><strong>Client Name: </strong> {{client.client_metadata.client_name}}</p>
</div>
- <fieldset>
+
+ <div class="form-group">
<legend>Scope</legend>
{%for scp in scope%}
- <input name="scope[]" id="chk:{{scp}}" type="checkbox" value="{{scp}}"
- {%if scp in client.client_metadata.scope%}
- checked="checked"
- {%endif%} />
- <label for="chk:{{scp}}">{{scp}}</label><br />
+ <div class="checkbox">
+ <label for="chk:{{scp}}">
+ <input name="scope[]" id="chk:{{scp}}" type="checkbox" value="{{scp}}"
+ {%if scp in client.client_metadata.scope%}
+ checked="checked"
+ {%endif%} />
+ {{scp}}</label><br />
+ </div>
{%endfor%}
- </fieldset>
+ </div>
- <fieldset>
+ <div class="form-group">
<legend>Redirect URIs</legend>
- <label for="txt-redirect-uri">Default Redirect URI</label>
+ <label for="txt-redirect-uri" class="form-label">Default Redirect URI</label>
<br />
- <input type="text" name="redirect_uri" id="txt-redirect-uri"
+ <input type="text"
+ name="redirect_uri"
+ id="txt-redirect-uri"
value="{{client.client_metadata.default_redirect_uri}}"
required="required"
class="form-control" />
- <br /><br />
+ </div>
- <label for="txta:other-redirect-uris">Other Redirect URIs</label>
- <br />
+ <div class="form-group">
+ <label for="txta:other-redirect-uris"
+ class="form-label">Other Redirect URIs</label>
<textarea id="txta:other-redirect-uris"
name="other_redirect_uris"
cols="80" rows="10"
+ class="form-control"
title="Enter one URI per line."
>{{"\r\n".join(client.client_metadata.redirect_uris)}}</textarea>
- </fieldset>
+ </div>
- <fieldset>
+ <div class="form-group">
<legend>Grants</legend>
- {%for granttype in granttypes%}
- <input name="grants[]"
- type="checkbox"
- value="{{granttype.value}}"
- id="chk-{{granttype.name.lower().replace(' ', '-')}}"
- {%if granttype.value in client.client_metadata.grant_types%}
- checked="checked"
- {%endif%} />
+ {%for granttype in granttypes%}
+ <div class="checkbox">
<label for="chk-{{granttype.name.lower().replace(' ', '-')}}">
+ <input name="grants[]"
+ type="checkbox"
+ value="{{granttype.value}}"
+ id="chk-{{granttype.name.lower().replace(' ', '-')}}"
+ {%if granttype.value in client.client_metadata.grant_types%}
+ checked="checked"
+ {%endif%} />
{{granttype.name}}
</label>
- <br /><br />
- {%endfor%}
- </fieldset>
-
- <input type="submit" class="btn btn-primary" value="update client" />
-</form>
-
-<hr />
-<h2>Signing/Verification SSL Keys</h2>
-<table>
- <caption>Registered Public Keys</caption>
- <thead>
- <tr>
- <th>JWK Thumbprint</th>
- <th>Actions</th>
- </tr>
- </thead>
-
- <tbody>
- {%for sslkey in client.jwks.keys:%}
- <tr>
- <td>{{sslkey.thumbprint()}}</td>
- <td>
- <form method="POST"
- action="{{url_for('oauth2.admin.delete_client_public_key')}}">
- <input type="hidden"
- name="client_id"
- value="{{client.client_id}}" />
- <input type="hidden"
- name="ssl_key"
- value="{{sslkey.thumbprint()}}" />
- <input type="submit"
- class="btn btn-danger"
- value="delete key" />
- </form>
- </td>
- </tr>
- {%else%}
- <tr>
- <td class="alert-warning"
- colspan="2">
- There are no registered SSL keys for this client.
- </td>
- </tr>
+ </div>
{%endfor%}
- </tbody>
-</table>
-<form id="frm-client-add-ssl-key"
- method="POST"
- action="{{url_for('oauth2.admin.register_client_public_key')}}">
- <legend>Register new SSL key</legend>
- <input type="hidden" name="client_id" value="{{client.client_id}}" />
- <fieldset>
- <label for="txt-area-client-ssl-key">Client's Public Key</label>
- <textarea id="txt-area-client-ssl-key"
- name="client_ssl_key"
- required="required"
- class="form-control"
- rows="10"></textarea>
- </fieldset>
+ </div>
+
+ <legend>Other metadata</legend>
+ <div class="form-group">
+ <label class="form-group" for="txt-client-jwk-uri">
+ Client's Public JWKs</label>
+ <input type="text"
+ id="txt-client-jwk-uri"
+ name="client_jwk_uri"
+ class="form-control"
+ value="{{client.client_metadata.get('public-jwks-uri', '')}}" />
+ </div>
- <br />
- <input type="submit" class="btn btn-primary" value="register key" />
+ <input type="submit" class="btn btn-primary" value="update client" />
</form>
{%endif%}
diff --git a/gn_auth/templates/emails/forgot-password.html b/gn_auth/templates/emails/forgot-password.html
new file mode 100644
index 0000000..e40ebb8
--- /dev/null
+++ b/gn_auth/templates/emails/forgot-password.html
@@ -0,0 +1,38 @@
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>{{subject}}</title>
+ </head>
+ <body>
+ <p>
+ You (or someone pretending to be you) made a request to change your
+ password. Please follow the link below to change it.
+ </p>
+
+ <p>
+ Click the button below to change your password
+ <a href="{{forgot_password_uri}}"
+ style="display: block;text-align: center;vertical-align: center;cursor: pointer;border-radius: 4px;background-color: #336699;border-color: #357ebd;color: white;text-decoration: none;font-size: large;width: 9em;text-transform: capitalize;margin: 1em 0 0 3em;box-shadow: 2px 2px rgba(0, 0, 0, 0.3);">Change my Password</a>.</p>
+
+ <p>
+ Or copy the link below onto your browser's address bar:<br /><br />
+ <span style="font-weight: bolder;">{{forgot_password_uri}}</span>
+ </p>
+
+ <p>
+ If you did not request to change your password, simply ignore this email.
+ </p>
+
+ <p style="font-weight: bold;color: #ee55ee;">
+ The link will expire in <strong>{{expiration_minutes}}</strong> minutes.
+ </p>
+
+ <hr />
+ <p>
+ <small>
+ Note that if you requested to change your password multiple times, only
+ the latest/newest token will be valid.
+ </small>
+ </p>
+ </body>
+</html>
diff --git a/gn_auth/templates/emails/forgot-password.txt b/gn_auth/templates/emails/forgot-password.txt
new file mode 100644
index 0000000..55a4b13
--- /dev/null
+++ b/gn_auth/templates/emails/forgot-password.txt
@@ -0,0 +1,12 @@
+{{subject}}
+===============
+
+You (or someone pretending to be you) made a request to change your password. Please copy the link below onto your browser to change your password:
+
+{{forgot_password_uri}}
+
+If you did not request to change your password, simply ignore this email.
+
+The link will expire {{expiration_minutes}} minutes.
+
+Note that if you requested to change your password multiple times, only the latest/newest token will be valid.
diff --git a/gn_auth/templates/oauth2/authorise-user.html b/gn_auth/templates/oauth2/authorise-user.html
index d69bdd4..2ef22af 100644
--- a/gn_auth/templates/oauth2/authorise-user.html
+++ b/gn_auth/templates/oauth2/authorise-user.html
@@ -29,7 +29,17 @@
<input type="password" name="user:password" id="user:password"
required="required" class="form-control" />
</div>
-
- <input type="submit" value="authorise" class="btn btn-primary" />
+
+ <div class="form-group">
+ <input type="submit" value="authorise" class="btn btn-primary" />
+ {%if display_forgot_password%}
+ <a href="{{url_for('oauth2.users.forgot_password',
+ client_id=client.client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type)}}"
+ title="Click here to change your password."
+ class="form-text text-danger">Forgot Password</a>
+ {%endif%}
+ </div>
</form>
{%endblock%}
diff --git a/gn_auth/templates/users/change-password.html b/gn_auth/templates/users/change-password.html
new file mode 100644
index 0000000..f328255
--- /dev/null
+++ b/gn_auth/templates/users/change-password.html
@@ -0,0 +1,52 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Change Password{%endblock%}
+
+{%block pagetitle%}Change Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Change Password</h1></div>
+
+ <div class="row">
+ <form method="POST"
+ action="{{url_for('oauth2.users.change_password',
+ client_id=client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type,
+ forgot_password_token=forgot_password_token)}}">
+ <div class="form-group">
+ <p class="form-text text-info">
+ Change the password for your account with the email
+ "<strong>{{email}}</strong>".
+ </p>
+ </div>
+
+ <div class="form-group">
+ <label for="txt-password" class="form-label">New Password</label>
+ <input type="password"
+ id="txt-password"
+ name="password"
+ class="form-control"
+ required="required" />
+ </div>
+
+ <div class="form-group">
+ <label for="txt-confirm" class="form-label">Confirm New Password</label>
+ <input type="password"
+ id="txt-confirm"
+ name="confirm-password"
+ class="form-control"
+ required="required" />
+ </div>
+
+ <div class="form-group">
+ <input type="submit" class="btn btn-danger" value="change password" />
+ </div>
+ </form>
+ </div>
+
+</div>
+{%endblock%}
diff --git a/gn_auth/templates/users/forgot-password-token-send-success.html b/gn_auth/templates/users/forgot-password-token-send-success.html
new file mode 100644
index 0000000..8782e8c
--- /dev/null
+++ b/gn_auth/templates/users/forgot-password-token-send-success.html
@@ -0,0 +1,22 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Forgot Password{%endblock%}
+
+{%block pagetitle%}Forgot Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Forgot Password</h1></div>
+
+ <div class="row">
+ <p class="text-info"
+ style="font-size:1.5em;text-align:center;margin-top:2em;">
+ We have sent an email to '<strong>{{email}}</strong>'. Please use the link
+ in the email we sent to change your password.
+ </p>
+ </div>
+
+</div>
+{%endblock%}
diff --git a/gn_auth/templates/users/forgot-password.html b/gn_auth/templates/users/forgot-password.html
new file mode 100644
index 0000000..0455c69
--- /dev/null
+++ b/gn_auth/templates/users/forgot-password.html
@@ -0,0 +1,38 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Forgot Password{%endblock%}
+
+{%block pagetitle%}Forgot Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Forgot Password</h1></div>
+
+ <div class="row">
+ <form method="POST"
+ action="{{url_for('oauth2.users.forgot_password',
+ client_id=client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type)}}">
+ <div class="form-group">
+ <span>
+ Provide you email below, and we will send you a link you can use to
+ change your password.
+ </span>
+ </div>
+
+ <div class="form-group">
+ <label for="txt-email" class="form-label">Email</label>
+ <input type="email" name="email" id="txt-email" class="form-control" />
+ </div>
+
+ <div class="form-group">
+ <input type="submit" class="btn btn-primary" value="Send Link" />
+ </div>
+ </form>
+ </div>
+
+</div>
+{%endblock%}
diff --git a/gn_auth/templates/users/unverified-user.html b/gn_auth/templates/users/unverified-user.html
index 0ce141d..fcd34ad 100644
--- a/gn_auth/templates/users/unverified-user.html
+++ b/gn_auth/templates/users/unverified-user.html
@@ -7,69 +7,87 @@
{%block content%}
{{flash_messages()}}
-<h1>Verify Your E-Mail</h1>
-
-<form id="frm-email-verification" method="POST"
- action="{{url_for('oauth2.users.verify_user')}}">
- <legend>Email Verification</legend>
-
- <p>In order to reduce the number of bots we have to deal with, we no longer
- allow sign-in with users who have not verified their accounts.</p>
-
- <p>We know this is annoying &mdash; especially if you already have an account,
- and have been using it just fine &mdash; however, we have found that without
- this check in place, we will get overrun by silly bots, which will ruin
- every user's experience.</p>
-
- <p>
- Do bear with us, enter the verification code you received via email below:
- </p>
-
- <input type="hidden" name="email" value="{{email}}" />
- <input type="hidden" name="response_type" value="{{response_type}}" />
- <input type="hidden" name="client_id" value="{{client_id}}" />
- <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
-
- <fieldset class="form-group">
- <label for="txt-verification-code" class="form-label">
- Verification Code</label>
- <input id="txt-verification-code" name="verificationcode" type="text"
- required="required" class="form-control"
- placeholder="Enter your verification code here." />
- </fieldset>
-
- <fieldset>
- <input type="submit" value="Verify Email Address" class="btn btn-primary" />
- </fieldset>
-</form>
-
-<h2>Send Verification Code</h2>
-
-<form id="frm-send-verification-code" method="POST"
- action="{{url_for('oauth2.users.send_verification_code')}}">
- <legend>Send Verification Code</legend>
-
- <p>If you have not received a verification code, or your code is already
- expired, provide <strong>your GeneNetwork</strong> password and
- click the "<em>Send Verification Code</em>" button below and we will send
- you a new verification code.</p>
-
- <input type="hidden" name="user_email" value="{{email}}" />
- <input type="hidden" name="response_type" value="{{response_type}}" />
- <input type="hidden" name="client_id" value="{{client_id}}" />
- <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
-
- <fieldset class="form-group">
- <label class="form-label">Email</label>
- <label class="form-control">{{email}}</label>
- </fieldset>
-
- <fieldset class="form-group">
- <label for="txt-password" class="form-label">Password</label>
- <input id="txt-password" name="user_password" type="password"
- placeholder="Enter your GeneNetwork password"
- class="form-control" />
- </fieldset>
- <input type="submit" value="Send Verification Code" class="btn btn-danger" />
-</form>
+<div class="container-fluid">
+ <div class="row"><h1>Verify Your E-Mail</h1></div>
+
+ {%if token_found:%}
+ <div class="row">
+ <form id="frm-email-verification" method="POST"
+ action="{{url_for('oauth2.users.verify_user')}}">
+ <legend>Email Verification</legend>
+
+ <p>If you are seeing this, your account needs to be verified.</p>
+
+ <p>An email with a verification token has already been sent to the address
+ associated with this account (<em>{{email}}</em>). Please provide that
+ verification token below and click the "<em>Verify Email Address</em>"
+ button to verify your account.</p>
+
+ <input type="hidden" name="email" value="{{email}}" />
+ <input type="hidden" name="response_type" value="{{response_type}}" />
+ <input type="hidden" name="client_id" value="{{client_id}}" />
+ <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
+
+ <fieldset class="form-group">
+ <label for="txt-verification-code" class="form-label">
+ Verification Code</label>
+ <input id="txt-verification-code" name="verificationcode" type="text"
+ required="required" class="form-control"
+ placeholder="Enter your verification code here." />
+ </fieldset>
+
+ <fieldset>
+ <input type="submit" value="Verify Email Address" class="btn btn-primary" />
+ </fieldset>
+ </form>
+ </div>
+ {%else:%}
+ <div class="row">
+ <form id="frm-send-verification-code" method="POST"
+ action="{{url_for('oauth2.users.send_verification_code')}}">
+ <legend>Send Verification Code</legend>
+
+ <p>Provide your password below, and we will send you a verification password
+ to your email.</p>
+ <p>You are seeing this page because:</p>
+ <ol type="a">
+ <li>You already had an existing account.<br />
+ In this case, you will need to request a verification code by
+ providing your email below and clicking the
+ "<em>Send Verification Code</em>" button.<br />
+ We will send you an email with both:
+ <ol type="1">
+ <li>a link you can click to verify your email, <strong>and</strong>
+ </li>
+ <li>a token to copy and paste if you choose not to follow the link.
+ </li>
+ </ol>
+ </li>
+ <li>You registered your account recently, but did not verify it within the
+ time period allocated for that. In this case, simply request a new
+ verification email below, and follow the link, or copy and paste the
+ token in the email we send you.</li>
+ </ol>
+
+ <input type="hidden" name="user_email" value="{{email}}" />
+ <input type="hidden" name="response_type" value="{{response_type}}" />
+ <input type="hidden" name="client_id" value="{{client_id}}" />
+ <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
+
+ <fieldset class="form-group">
+ <label class="form-label">Email</label>
+ <label class="form-control">{{email}}</label>
+ </fieldset>
+
+ <fieldset class="form-group">
+ <label for="txt-password" class="form-label">Password</label>
+ <input id="txt-password" name="user_password" type="password"
+ placeholder="Enter your GeneNetwork password"
+ class="form-control" />
+ </fieldset>
+ <input type="submit" value="Send Verification Code" class="btn btn-danger" />
+ </form>
+ </div>
+ {%endif%}
+</div>
{%endblock%}