Add new device_auth_client_type setting to allow attaching the client_secret to device auth requests

This commit is contained in:
Joe Kralicky 2024-06-06 15:57:37 -04:00
parent 18aed33aa5
commit b4aa275403
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
11 changed files with 312 additions and 249 deletions

View file

@ -63,14 +63,17 @@ func (p *Proxy) registerDashboardHandlers(r *mux.Router, opts *config.Options) *
return nil
}
return p.routesPortalJSON(w, r)
case dashboardPath + "/v1/device_auth":
if r.Method != http.MethodGet {
http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return nil
}
return p.DeviceAuthLogin(w, r)
}
http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
return nil
}))
a.Path("/v1/device_auth").Handler(httputil.HandlerFunc(p.DeviceAuthLogin)).
Methods(http.MethodGet, http.MethodPost)
return r
}