@@ -73,7 +73,7 @@ func TestAuthorizeCode(t *testing.T) {
7373 WithFormField ("code" , code ).
7474 WithFormField ("grant_type" , "authorization_code" ).
7575 WithFormField ("client_id" , clientID ).
76- WithFormField ( "client_secret" , clientSecret ).
76+ WithBasicAuth ( clientID , clientSecret ).
7777 Expect ().
7878 Status (http .StatusOK ).
7979 JSON ().Raw ()
@@ -145,11 +145,10 @@ func TestPasswordCredentials(t *testing.T) {
145145
146146 val := e .POST ("/token" ).
147147 WithFormField ("grant_type" , "password" ).
148- WithFormField ("client_id" , clientID ).
149- WithFormField ("client_secret" , clientSecret ).
150148 WithFormField ("username" , "admin" ).
151149 WithFormField ("password" , "123456" ).
152150 WithFormField ("scope" , "all" ).
151+ WithBasicAuth (clientID , clientSecret ).
153152 Expect ().
154153 Status (http .StatusOK ).
155154 JSON ().Raw ()
@@ -169,9 +168,8 @@ func TestClientCredentials(t *testing.T) {
169168
170169 val := e .POST ("/token" ).
171170 WithFormField ("grant_type" , "client_credentials" ).
172- WithFormField ("client_id" , clientID ).
173- WithFormField ("client_secret" , clientSecret ).
174171 WithFormField ("scope" , "all" ).
172+ WithBasicAuth (clientID , clientSecret ).
175173 Expect ().
176174 Status (http .StatusOK ).
177175 JSON ().Raw ()
@@ -200,7 +198,7 @@ func TestRefreshing(t *testing.T) {
200198 WithFormField ("code" , code ).
201199 WithFormField ("grant_type" , "authorization_code" ).
202200 WithFormField ("client_id" , clientID ).
203- WithFormField ( "client_secret" , clientSecret ).
201+ WithBasicAuth ( clientID , clientSecret ).
204202 Expect ().
205203 Status (http .StatusOK ).
206204 JSON ()
@@ -210,10 +208,9 @@ func TestRefreshing(t *testing.T) {
210208 refresh := jval .Object ().Value ("refresh_token" ).String ().Raw ()
211209 rval := e .POST ("/token" ).
212210 WithFormField ("grant_type" , "refresh_token" ).
213- WithFormField ("client_id" , clientID ).
214- WithFormField ("client_secret" , clientSecret ).
215211 WithFormField ("scope" , "one" ).
216212 WithFormField ("refresh_token" , refresh ).
213+ WithBasicAuth (clientID , clientSecret ).
217214 Expect ().
218215 Status (http .StatusOK ).
219216 JSON ().Raw ()
0 commit comments