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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OIDC Playground</title>
<link rel="stylesheet" href="/_/styles.css">
<link rel="stylesheet" href="/_/prism.css">
</head>
<body>
<div class="container">
<h1>OIDC Playground</h1>
<div class="section">
<h2>Configuration</h2>
<form id="oidc-form" method="POST" action="/">
<div class="form-group">
<label for="issuer">Issuer URL:</label>
<input type="url" id="issuer" name="client_provider" required
placeholder="https://example.com/auth/realms/master" value="{{ .Issuer }}">
</div>
<div class="form-group">
<label for="client-id">Client ID:</label>
<input type="text" id="client-id" name="client_id" required placeholder="your-client-id" value="{{ .ClientID }}">
</div>
<div class="form-group">
<label for="client-secret">Client Secret:</label>
<input type="password" id="client-secret" name="client_secret"
placeholder="your-client-secret (optional for public clients)" value="{{ .ClientSecret }}">
</div>
<div class="form-group">
<label for="scopes">Scopes:</label>
<input type="text" id="scopes" name="scopes" value="openid profile email" placeholder="openid profile email" value="{{ .Scopes }}">
</div>
<div class="form-group">
<label for="redirect-uri">Redirect URI:</label>
<input type="url" id="redirect-uri" style="user-select: all;" required readonly value="{{ .RedirectURI }}">
</div>
<button type="submit">Start Authentication</button>
</form>
</div>
{{ if .Results }}
<div class="section" id="results-section">
<h2>Results</h2>
<div class="result-group">
<h3>Token Claims</h3>
<pre><code id="id-token-claims" class="language-json">{{ .TokenClaims }}</code></pre>
</div>
<div class="result-group">
<h3>User Info</h3>
<pre><code id="user-info" class="language-json">{{ .UserInfo }}</code></pre>
</div>
<div class="result-group">
<h3>Token Response</h3>
<pre><code id="token-response" class="language-json">{{ .TokenResponse }}</code></pre>
</div>
</div>
<div class="section">
<h2>Instructions</h2>
<ol>
<li>Fill in your OIDC provider details above</li>
<li>Make sure your redirect URI is registered with your OIDC provider</li>
<li>Click "Start OIDC Flow" to begin authentication</li>
<li>After successful authentication, view the tokens and claims below</li>
</ol>
</div>
</div>
{{ end }}
<script src="/_/script.js"></script>
<script src="/_/prism.js"></script>
</body>
</html>
|