add test for requested scope presence
This commit is contained in:
parent
44b418c771
commit
23df01e826
1 changed files with 6 additions and 0 deletions
|
|
@ -242,6 +242,11 @@ func TestRefreshAccessToken(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.FormValue("scope") != "test-scope" {
|
||||||
|
http.Error(w, "invalid scope", http.StatusBadRequest)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
resp := map[string]any{
|
resp := map[string]any{
|
||||||
"access_token": "refreshed-access-token",
|
"access_token": "refreshed-access-token",
|
||||||
"refresh_token": "refreshed-refresh-token",
|
"refresh_token": "refreshed-refresh-token",
|
||||||
|
|
@ -254,6 +259,7 @@ func TestRefreshAccessToken(t *testing.T) {
|
||||||
cfg := OAuthProviderConfig{
|
cfg := OAuthProviderConfig{
|
||||||
Issuer: server.URL,
|
Issuer: server.URL,
|
||||||
ClientID: "test-client",
|
ClientID: "test-client",
|
||||||
|
Scopes: "test-scope",
|
||||||
}
|
}
|
||||||
|
|
||||||
cred := &AuthCredential{
|
cred := &AuthCredential{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue