feat(ui): implement OAuth login flow and dashboard components
Some checks failed
CI / build-and-test (push) Failing after -32m0s
Some checks failed
CI / build-and-test (push) Failing after -32m0s
* Add OAuth login handling in app and UI components * Create new components for login and dashboard pages * Refactor sidebar and navigation structure * Introduce types for access entries and status responses
This commit is contained in:
@@ -67,9 +67,9 @@ func oauthMetadataHandler() http.HandlerFunc {
|
||||
base := serverBaseURL(r)
|
||||
meta := oauthServerMetadata{
|
||||
Issuer: base,
|
||||
AuthorizationEndpoint: base + "/authorize",
|
||||
TokenEndpoint: base + "/oauth/token",
|
||||
RegistrationEndpoint: base + "/oauth/register",
|
||||
AuthorizationEndpoint: base + "/api/oauth/authorize",
|
||||
TokenEndpoint: base + "/api/oauth/token",
|
||||
RegistrationEndpoint: base + "/api/oauth/register",
|
||||
ScopesSupported: []string{"mcp"},
|
||||
ResponseTypesSupported: []string{"code"},
|
||||
GrantTypesSupported: []string{"authorization_code", "client_credentials"},
|
||||
@@ -244,6 +244,10 @@ func oauthTokenHandler(oauthRegistry *auth.OAuthRegistry, tokenStore *auth.Token
|
||||
|
||||
switch r.FormValue("grant_type") {
|
||||
case "client_credentials":
|
||||
if oauthRegistry == nil {
|
||||
writeTokenError(w, "unsupported_grant_type", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
handleClientCredentials(w, r, oauthRegistry, tokenStore, log)
|
||||
case "authorization_code":
|
||||
handleAuthorizationCode(w, r, authCodes, tokenStore, log)
|
||||
@@ -334,7 +338,7 @@ button{padding:.5rem 1.2rem;margin-right:.5rem;cursor:pointer;font-size:1rem}
|
||||
<body>
|
||||
<h2>Authorize Access</h2>
|
||||
<p><strong>%s</strong> is requesting access to this AMCS server.</p>
|
||||
<form method=POST action=/oauth/authorize>
|
||||
<form method=POST action=/api/oauth/authorize>
|
||||
<input type=hidden name=client_id value="%s">
|
||||
<input type=hidden name=redirect_uri value="%s">
|
||||
<input type=hidden name=state value="%s">
|
||||
|
||||
Reference in New Issue
Block a user