Files
hertzbeat/mcp-servers/mcp-bash-server/templates/mcp_oauth_authorize.html
T
2026-08-25 23:40:41 +08:00

149 lines
4.4 KiB
HTML

<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCP OAuth</title>
<style>
:root {
--primary-color: #4285f4;
--secondary-color: #f1f1f1;
--text-color: #333;
--border-color: #ddd;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #f8f9fa;
color: var(--text-color);
}
.container {
background: white;
padding: 2rem;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
max-width: 600px;
width: 90%;
margin: 1rem;
}
h1 {
margin: 0 0 1.5rem 0;
font-size: 1.8rem;
text-align: center;
}
.client-info {
background: var(--secondary-color);
padding: 1rem;
border-radius: 8px;
margin-bottom: 1.5rem;
}
.btn-group {
display: flex;
gap: 1rem;
justify-content: center;
}
.approval-secret {
margin-bottom: 1.5rem;
}
.approval-secret label {
display: block;
font-weight: 600;
margin-bottom: 0.5rem;
}
.approval-secret input {
box-sizing: border-box;
width: 100%;
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: 6px;
font-size: 1rem;
}
.btn {
padding: 0.75rem 1.5rem;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
transition: all 0.2s;
border: none;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: #3367d6;
}
.btn-secondary {
background-color: var(--secondary-color);
color: var(--text-color);
border: 1px solid var(--border-color);
}
.btn-secondary:hover {
background-color: #e0e0e0;
}
</style>
</head>
<body>
<div class="container">
<h1>MCP OAuth</h1>
<div class="client-info">
<p><strong>{{ client_id }}</strong> requests access to your account.</p>
<p>requested scopes: {{ scopes }}</p>
</div>
<form action="/approve" method="post">
<input type="hidden" name="transaction_id" value="{{ transaction_id }}">
<input type="hidden" name="consent_nonce" value="{{ consent_nonce }}">
<div class="approval-secret">
<label for="approval_secret">Approval secret</label>
<input id="approval_secret" name="approval_secret" type="password"
minlength="32" autocomplete="current-password" required>
</div>
<div class="btn-group">
<button type="submit" name="approved" value="true" class="btn btn-primary">Approve</button>
<button type="submit" name="approved" value="false" class="btn btn-secondary">Reject</button>
</div>
</form>
</div>
</body>
</html>