aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates/admin/view-oauth2-client.html
blob: c250ee381af14c1bb6adda7b1d238c47b9d90831 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{%extends "base.html"%}

{%block title%}gn-auth: 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}}" />
  <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>
  </div>

  <div class="form-group">
    <legend>Scope</legend>
    {%for scp in scope%}
    <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%}
  </div>

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

  <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>
  </div>

  <div class="form-group">
    <legend>Grants</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(' ', '-')}}"
               {%if granttype.value in client.client_metadata.grant_types%}
	       checked="checked"
               {%endif%} />
        {{granttype.name}}
      </label>
    </div>
    {%endfor%}
  </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>

  <input type="submit" class="btn btn-primary" value="update client" />
</form>

{%endif%}
{%endblock%}