add test for requested scope presence

This commit is contained in:
urgerestraint 2026-02-22 20:15:05 +11:00
parent 44b418c771
commit 23df01e826

View file

@ -242,6 +242,11 @@ func TestRefreshAccessToken(t *testing.T) {
return
}
if r.FormValue("scope") != "test-scope" {
http.Error(w, "invalid scope", http.StatusBadRequest)
return
}
resp := map[string]any{
"access_token": "refreshed-access-token",
"refresh_token": "refreshed-refresh-token",
@ -254,6 +259,7 @@ func TestRefreshAccessToken(t *testing.T) {
cfg := OAuthProviderConfig{
Issuer: server.URL,
ClientID: "test-client",
Scopes: "test-scope",
}
cred := &AuthCredential{