-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.html
49 lines (49 loc) · 1.46 KB
/
form.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Generate a signed JWT</title>
</head>
<body>
<form method="POST" id="jwt" enctype="multipart/form-data">
<label>Subject:<br />
<input type="text" name="sub" value="{{ .Subject }}" />
</label><br />
<hr />
<label>Scope:<br />
<input type="text" name="scope" value="{{ .Scope }}" />
</label><br />
<label>IssuedAt:<br />
<input type="number" name="iat" value="{{ .IssuedAt }}" />
</label><br />
<label>Expiry:<br />
<input type="number" name="exp" value="{{ .Expiry }}" />
</label><br />
<hr />
<label>Issuer:<br />
<input type="text" name="iss" value="{{ .Issuer }}" />
</label><br />
<label>AuthorizingParty:<br />
<input type="text" name="azp" value="{{ .AuthorizingParty }}" />
</label><br />
<label>Audience:<br />
<input type="text" name="aud" value="{{ .Audience }}" />
</label><br />
<hr />
<input type="submit" value="Submit" />
<p id="info"></p>
</form>
<script>
const params = new URLSearchParams(document.location.search);
const redirectUri = params.get("redirect_uri");
if (redirectUri === null) {
document.getElementById("info").innerText =
"No `redirect_uri` query param - submitting this form will respond with the signed JWT";
} else {
document.getElementById("info").innerText =
"`redirect_uri` present - submitting this form will redirect to " +
redirectUri;
}
</script>
</body>
</html>