summaryrefslogtreecommitdiffstats
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html112
1 files changed, 112 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..fa6c165
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,112 @@
+{% extends "admin/base.html" %}
+{% block content %}
+<div class="jumbotron">
+ <div class="container">
+ <h1>
+ OIDC Identity Provider Configuration
+ </h1>
+ </div>
+</div>
+
+<div class="container">
+ <div class="row pb-4">
+ <div class="col-md-12">
+ <ul class="nav nav-tabs nav-fill" role="tablist">
+ <li class="nav-item">
+ <a class="nav-link active" data-toggle="tab" href="#setup" role="tab">
+ Setup
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" data-toggle="tab" href="#clients" role="tab">
+ Clients
+ </a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" data-toggle="tab" href="#keys" role="tab">
+ Signing Keys
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12 table-responsive">
+ <div class="tab-content">
+ <div class="tab-pane fade show active" id="setup" role="tabpanel">
+ <form method="POST" action="{{ url_for('oidc_admin.config') }}">
+ <input id="nonce" name='nonce' type='hidden' value="{{ Session.nonce }}">
+
+ <div class="form-group">
+ <b><label>Base URL</label></b>
+ <input name="base_url" class="form-control" value="{{ baseUrl }}" required>
+ <small class="form-text text-muted">
+ Set this to the URL that this CTFd instance is accessible at (including the protocol).
+ This is required for OIDC discovery to work properly.
+ </small>
+ </div>
+
+ <button class="btn btn-primary mt-3">Save</button>
+ </form>
+ </div>
+ <div class="tab-pane fade" id="clients" role="tabpanel">
+ <table class="table pb-8">
+ <tr>
+ <th>Client ID</th>
+ <th>Client secret</th>
+ <th>Redirect URIs</th>
+ <th></th>
+ </tr>
+ {% for c in clients %}
+ <tr>
+ <td>{{ c.client_id }}</td>
+ <td>{{ c.client_secret }}</td>
+ <td><small>{{ c.redirect_uris }}</small></td>
+ <td>
+ <form method="POST" action="{{ url_for('oidc_admin.delete_client', client_id=c.client_id) }}">
+ <input id="nonce" name='nonce' type='hidden' value="{{ Session.nonce }}">
+
+ <button class="btn btn-danger btn-sm">Delete</button>
+ </form>
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+
+ <h2>Create new client</h2>
+
+ <form method="POST" action="{{ url_for('oidc_admin.clients' )}}">
+ <input id="nonce" name='nonce' type='hidden' value="{{ Session.nonce }}">
+
+ <div class="form-group">
+ <b><label>Client ID</label></b>
+ <input name="client_id" class="form-control" required>
+ </div>
+
+ <div class="form-group">
+ <b><label>Redirect URIs (one per line)</label></b>
+ <textarea name="redirect_uris" class="form-control" required></textarea>
+ </div>
+
+ <button class="btn btn-primary mt-3">Create</button>
+ </form>
+ </div>
+ <div class="tab-pane fade" id="keys" role="tabpanel">
+ <table class="table pb-4">
+ <tr>
+ <th>KID</th>
+ <th>Created</th>
+ </tr>
+ {% for k in keys %}
+ <tr>
+ <td>{{ k.kid }}</td>
+ <td>{{ k.created }}</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+{% endblock %}