@@ -218,38 +218,6 @@ describe('Authorization Handler', () => {
218
218
} ) ;
219
219
} ) ;
220
220
221
- describe ( 'Scope validation' , ( ) => {
222
- it ( 'validates requested scopes against client registered scopes' , async ( ) => {
223
- const response = await supertest ( app ) . get ( '/authorize' ) . query ( {
224
- client_id : 'valid-client' ,
225
- redirect_uri : 'https://example.com/callback' ,
226
- response_type : 'code' ,
227
- code_challenge : 'challenge123' ,
228
- code_challenge_method : 'S256' ,
229
- scope : 'profile email admin' // 'admin' not in client scopes
230
- } ) ;
231
-
232
- expect ( response . status ) . toBe ( 302 ) ;
233
- const location = new URL ( response . header . location ) ;
234
- expect ( location . searchParams . get ( 'error' ) ) . toBe ( 'invalid_scope' ) ;
235
- } ) ;
236
-
237
- it ( 'accepts valid scopes subset' , async ( ) => {
238
- const response = await supertest ( app ) . get ( '/authorize' ) . query ( {
239
- client_id : 'valid-client' ,
240
- redirect_uri : 'https://example.com/callback' ,
241
- response_type : 'code' ,
242
- code_challenge : 'challenge123' ,
243
- code_challenge_method : 'S256' ,
244
- scope : 'profile' // subset of client scopes
245
- } ) ;
246
-
247
- expect ( response . status ) . toBe ( 302 ) ;
248
- const location = new URL ( response . header . location ) ;
249
- expect ( location . searchParams . has ( 'code' ) ) . toBe ( true ) ;
250
- } ) ;
251
- } ) ;
252
-
253
221
describe ( 'Resource parameter validation' , ( ) => {
254
222
it ( 'propagates resource parameter' , async ( ) => {
255
223
const mockProviderWithResource = jest . spyOn ( mockProvider , 'authorize' ) ;
0 commit comments