aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates/oauth2
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/templates/oauth2')
-rw-r--r--gn_auth/templates/oauth2/authorise-user.html48
-rw-r--r--gn_auth/templates/oauth2/oauth2_error.html16
2 files changed, 64 insertions, 0 deletions
diff --git a/gn_auth/templates/oauth2/authorise-user.html b/gn_auth/templates/oauth2/authorise-user.html
new file mode 100644
index 0000000..b9284e5
--- /dev/null
+++ b/gn_auth/templates/oauth2/authorise-user.html
@@ -0,0 +1,48 @@
+{%extends "base.html"%}
+
+{%block title%}Authorise User{%endblock%}
+
+{%block pagetitle%}Authenticate to the API Server{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<form method="POST" action="{{url_for('oauth2.auth.authorise')}}">
+ <input type="hidden" name="response_type" value="{{response_type}}" />
+ <input type="hidden" name="scope" value="{{scope | join(' ')}}" />
+ <input type="hidden" name="client_id" value="{{client.client_id}}" />
+ <p>
+ You are authorising "{{client.client_metadata.client_name}}" to access
+ Genenetwork 3 with the following scope:
+ </p>
+ <fieldset>
+ <legend>Scope</legend>
+ {%for scp in scope%}
+ <div class="checkbox disabled">
+ <label for="scope:{{scp}}">
+ <input id="scope:{{scp}}" type="checkbox" name="scope[]" value="{{scp}}"
+ checked="checked" disabled="disabled" />
+ {{scp}}
+ </label>
+ </div>
+ {%endfor%}
+ </fieldset>
+
+ <fieldset>
+ <legend>User Credentials</legend>
+ <fieldset class="form-group">
+ <label for="user:email" class="form-label">Email</label>
+ <input type="email" name="user:email" id="user:email" required="required"
+ class="form-control"/>
+ </fieldset>
+
+ <fieldset class="form-group">
+ <label for="user:password" class="form-label">Password</label>
+ <input type="password" name="user:password" id="user:password"
+ required="required" class="form-control" />
+ </fieldset>
+ </fieldset>
+
+ <input type="submit" value="authorise" class="btn btn-primary" />
+</form>
+{%endblock%}
diff --git a/gn_auth/templates/oauth2/oauth2_error.html b/gn_auth/templates/oauth2/oauth2_error.html
new file mode 100644
index 0000000..ec9a500
--- /dev/null
+++ b/gn_auth/templates/oauth2/oauth2_error.html
@@ -0,0 +1,16 @@
+{%extends "base.html"%}
+
+{%block title%}OAuth2 Error{%endblock%}
+
+{%block pagetitle%}Error: {{error.status_code}}{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+There was an error trying to fulfill your request:
+
+<p>
+ <strong>{{error.error}}</strong>:
+ {{error.description}}
+</p>
+{%endblock%}