| 66 | } |
| 67 | |
| 68 | func extractRevokeClientCredentials(c *echo.Context, req *revokeRequest) (clientID, clientSecret string) { |
| 69 | // Try Basic auth first |
| 70 | authHeader := c.Request().Header.Get("Authorization") |
| 71 | if strings.HasPrefix(authHeader, "Basic ") { |
| 72 | decoded, err := base64.StdEncoding.DecodeString(strings.TrimPrefix(authHeader, "Basic ")) |
| 73 | if err == nil { |
| 74 | parts := strings.SplitN(string(decoded), ":", 2) |
| 75 | if len(parts) == 2 { |
| 76 | return parts[0], parts[1] |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | // Fall back to form params |
| 81 | return req.ClientID, req.ClientSecret |
| 82 | } |