@@ -410,3 +410,77 @@ def test_authorization_denied(self):
410
410
self .driver .find_element (By .CSS_SELECTOR , "header > h1" ).text ,
411
411
"Permission denied" ,
412
412
)
413
+
414
+ @retry ()
415
+ @apply_blueprint (
416
+ "default/flow-default-authentication-flow.yaml" ,
417
+ "default/flow-default-invalidation-flow.yaml" ,
418
+ )
419
+ @apply_blueprint ("default/flow-default-provider-authorization-implicit-consent.yaml" )
420
+ @apply_blueprint ("system/providers-oauth2.yaml" )
421
+ @reconcile_app ("authentik_crypto" )
422
+ def test_authorization_consent_implied_parallel (self ):
423
+ """test OpenID Provider flow (default authorization flow with implied consent)"""
424
+ # Bootstrap all needed objects
425
+ authorization_flow = Flow .objects .get (
426
+ slug = "default-provider-authorization-implicit-consent"
427
+ )
428
+ provider = OAuth2Provider .objects .create (
429
+ name = generate_id (),
430
+ client_type = ClientTypes .CONFIDENTIAL ,
431
+ client_id = self .client_id ,
432
+ client_secret = self .client_secret ,
433
+ signing_key = create_test_cert (),
434
+ redirect_uris = [
435
+ RedirectURI (
436
+ RedirectURIMatchingMode .STRICT , "http://localhost:3000/login/generic_oauth"
437
+ )
438
+ ],
439
+ authorization_flow = authorization_flow ,
440
+ )
441
+ provider .property_mappings .set (
442
+ ScopeMapping .objects .filter (
443
+ scope_name__in = [
444
+ SCOPE_OPENID ,
445
+ SCOPE_OPENID_EMAIL ,
446
+ SCOPE_OPENID_PROFILE ,
447
+ SCOPE_OFFLINE_ACCESS ,
448
+ ]
449
+ )
450
+ )
451
+ Application .objects .create (
452
+ name = generate_id (),
453
+ slug = self .app_slug ,
454
+ provider = provider ,
455
+ )
456
+
457
+ self .driver .get (self .live_server_url )
458
+ login_window = self .driver .current_window_handle
459
+
460
+ self .driver .switch_to .new_window ("tab" )
461
+ grafana_window = self .driver .current_window_handle
462
+ self .driver .get ("http://localhost:3000" )
463
+ self .driver .find_element (By .CLASS_NAME , "btn-service--oauth" ).click ()
464
+
465
+ self .driver .switch_to .window (login_window )
466
+ self .login ()
467
+
468
+ self .driver .switch_to .window (grafana_window )
469
+ self .wait_for_url ("http://localhost:3000/?orgId=1" )
470
+ self .driver .get ("http://localhost:3000/profile" )
471
+ self .assertEqual (
472
+ self .driver .find_element (By .CLASS_NAME , "page-header__title" ).text ,
473
+ self .user .name ,
474
+ )
475
+ self .assertEqual (
476
+ self .driver .find_element (By .CSS_SELECTOR , "input[name=name]" ).get_attribute ("value" ),
477
+ self .user .name ,
478
+ )
479
+ self .assertEqual (
480
+ self .driver .find_element (By .CSS_SELECTOR , "input[name=email]" ).get_attribute ("value" ),
481
+ self .user .email ,
482
+ )
483
+ self .assertEqual (
484
+ self .driver .find_element (By .CSS_SELECTOR , "input[name=login]" ).get_attribute ("value" ),
485
+ self .user .email ,
486
+ )
0 commit comments