oidc stuff

This commit is contained in:
nora 2025-07-13 15:37:29 +02:00
parent 4d7a2be572
commit 30c49c3795
12 changed files with 538 additions and 6 deletions

View file

@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login - IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>Register a new OAuth client</h1>
<a href="/">home</a>
<form method="post">
<div>
<label for="app_name">App Name</label>
<input id="app_name" name="app_name" />
</div>
<div>
<label for="redirect_uri">Redirect URI</label>
<input id="redirect_uri" name="redirect_uri" />
</div>
<div>
<label for="client_type">Client Type</label>
<select id="client_type" name="client_type">
<option value="confidential">confidential</option>
<option value="private">private</option>
</select>
</div>
<button type="submit">Create</button>
{% if let Some(error) = error %}
<p>error: {{error}}</p>
{% endif %}
</form>
</body>
</html>

View file

@ -9,9 +9,17 @@
<body>
<h1>Your favorite identity provider</h1>
<a href="/">home</a>
<p>OAuth Config</p>
<div>
<a href="/oauth-clients">List all OAuth clients</a>
</div>
<div>
<a href="/add-oauth-client">Register a new OAuth client</a>
</div>
{% if let Some(username) = username %}
<p>Hello, {{username}}!</p>
{% endif %}
<p>Login</p>
<div>
<a href="/signup">Create an account</a>
</div>
@ -22,6 +30,7 @@
<a href="/users">List all users</a>
</div>
{% if let Some(username) = username %}
<p>Account</p>
<div>
<a href="/sessions">List all active sessions your account</a>
</div>

View file

@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OAuth Clients - IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>See OAuth clients registered</h1>
<a href="/">home</a>
<table>
<thead>
<tr>
<th>App Name</th>
<th>Client ID</th>
<th>Redirect URI</th>
<th>Client Type</th>
<th>Client Secret</th>
</th>
</thead>
<tbody>
{% for client in clients %}
<tr>
<td>{{ client.app_name }}</td>
<td>{{ client.client_id }}</td>
<td>{{ client.redirect_uri }}</td>
<td>{{ client.client_type }}</td>
<td>{{ client.client_secret }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View file

@ -3,6 +3,10 @@ body {
width: 100%;
}
html {
font-family: sans-serif;
}
@media (prefers-color-scheme: dark) {
body {
background-color: rgb(41, 41, 41);
@ -53,3 +57,17 @@ form:not(.fake-form) {
.fake-form {
display: inline-block;
}
table {
th {
text-align: left;
}
th, td {
padding-bottom: 10px;
}
:is(td, th):not(:last-child) {
padding-right: 10px;
}
}