···541541542542// validateCredentials checks if the credentials are still valid by making a test request
543543func validateCredentials(appViewURL, handle, deviceSecret string) bool {
544544- // Make a request to /v2/ which requires authentication
544544+ // Call /auth/token to validate device secret and get JWT
545545+ // This is the proper way to validate credentials - /v2/ requires JWT, not Basic Auth
545546 client := &http.Client{
546547 Timeout: 5 * time.Second,
547548 }
548549549549- req, err := http.NewRequest("GET", appViewURL+"/v2/", nil)
550550+ // Build /auth/token URL with minimal scope (just access to /v2/)
551551+ tokenURL := appViewURL + "/auth/token?service=" + appViewURL
552552+553553+ req, err := http.NewRequest("GET", tokenURL, nil)
550554 if err != nil {
551555 return false
552556 }