aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates/admin/view-oauth2-client.html
blob: 9bc2c0db5e275b87b39bc6d99c61adf388ec2536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{%extends "base.html"%}

{%block title%}Genenetwork3: View OAuth2 Client{%endblock%}

{%block pagetitle%}View OAuth2 Client{%endblock%}

{%block content%}
{{flash_messages()}}

{%if client.is_nothing()%}
<p>No such client</p>
{%else%}
{%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}}" />
  <div>
    <p><strong>Client ID: <strong> {{client.client_id}}</p>
    <p><strong>Client Name: <strong> {{client.client_metadata.client_name}}</p>
  </div>
  <fieldset>
    <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 />
    {%endfor%}
  </fieldset>

  <fieldset>
    <legend>Redirect URIs</legend>
    <label for="txt-redirect-uri">Default Redirect URI</label>
    <br />
    <input type="text" name="redirect_uri" id="txt-redirect-uri"
	   value="{{client.client_metadata.default_redirect_uri}}"
	   required="required">
    <br /><br />

    <label for="txta:other-redirect-uris">Other Redirect URIs</label>
    <br />
    <textarea id="txta:other-redirect-uris"
	      name="other_redirect_uris"
	      cols="80" rows="10"
	      title="Enter one URI per line."
	      >{{"\r\n".join(client.client_metadata.redirect_uris)}}</textarea>
  </fieldset>

  <fieldset>
    <legend>Grants</legend>
    <input name="grants[]"
	   type="checkbox"
	   value="authorization_code"
	   id="chk:authorization-code"
	   {%if "authorization_code" in client.client_metadata.grant_types%}
	   checked="checked"
	   {%endif%} />
      <label for="chk:authorization-code">Authorization Code</label>
      <br /><br />

      <input name="grants[]"
	     type="checkbox"
	     value="refresh_token"
	     id="chk:refresh-token"
	     {%if "refresh_token" in client.client_metadata.grant_types%}
	     checked="checked"
	     {%endif%} />
      <label for="chk:refresh-token">Refresh Token</label>
  </fieldset>

  <input type="submit" value="update client" />
</form>
{%endif%}
{%endblock%}