@@ -54,7 +54,8 @@ groups() ->
5454 {verify_introspection_endpoint , [], [
5555 introspect_opaque_token_returns_active_jwt_token ,
5656 introspect_opaque_token_returns_inactive_jwt_token ,
57- introspect_opaque_token_returns_401_from_auth_server
57+ introspect_opaque_token_returns_401_from_auth_server ,
58+ idp_introspect_opaque_token
5859 ]}
5960 ]},
6061 {verify_multi_resource_and_provider , [], [
@@ -697,7 +698,9 @@ end_per_group(_, Config) ->
697698
698699init_per_testcase (Testcase , Config ) when Testcase =:= introspect_opaque_token_returns_active_jwt_token orelse
699700 Testcase =:= introspect_opaque_token_returns_inactive_jwt_token orelse
700- Testcase =:= introspect_opaque_token_returns_401_from_auth_server ->
701+ Testcase =:= introspect_opaque_token_returns_401_from_auth_server orelse
702+ Testcase =:= idp_introspect_opaque_token ->
703+
701704 ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , set_env ,
702705 [rabbitmq_auth_backend_oauth2 , introspection_endpoint ,
703706 ? config (authorization_server_url , Config )]),
@@ -721,7 +724,8 @@ init_per_testcase(Testcase, Config) ->
721724
722725end_per_testcase (Testcase , Config ) when Testcase =:= introspect_opaque_token_returns_active_jwt_token orelse
723726 Testcase =:= introspect_opaque_token_returns_inactive_jwt_token orelse
724- Testcase =:= introspect_opaque_token_returns_401_from_auth_server ->
727+ Testcase =:= introspect_opaque_token_returns_401_from_auth_server orelse
728+ Testcase =:= idp_introspect_opaque_token ->
725729 ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , unset_env ,
726730 [rabbitmq_auth_backend_oauth2 , introspection_endpoint ]),
727731 ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , unset_env ,
@@ -958,22 +962,24 @@ should_return_mgt_oauth_resource_a_with_token_endpoint_params_1(Config) ->
958962
959963introspect_opaque_token_returns_active_jwt_token (Config ) ->
960964 {ok , {{_HTTP , 200 , _ }, _Headers , ResBody }} = req (Config , 0 , post , " /auth/introspect" , [
961- {" authorization" , " bearer active" }], []),
962-
963- Split = binary :split (rabbit_data_coercion :to_binary (ResBody ), <<" ." >>),
964- ct :log (" split: ~p " , [Split ]).
965+ {" authorization" , " bearer active" }], []).
965966
966967introspect_opaque_token_returns_inactive_jwt_token (Config ) ->
967968 {ok , {{_HTTP , 401 , _ }, _Headers , ResBody }} = req (Config , 0 , post , " /auth/introspect" , [
968969 {" authorization" , " bearer inactive" }], []),
969- JSON = rabbit_json :decode (rabbit_data_coercion :to_binary (ResBody )),
970+ JSON = rabbit_json :decode (rabbit_data_coercion :to_binary (ResBody )),
970971 ? assertEqual (<<" not_authorised" >>, maps :get (<<" error" >>, JSON )),
971972 ? assertEqual (<<" Introspected token is not active" >>, maps :get (<<" reason" >>, JSON )).
972973
973974introspect_opaque_token_returns_401_from_auth_server (Config ) ->
974975 {ok , {{_HTTP , 401 , _ }, _Headers , _ResBody }} = req (Config , 0 , post , " /auth/introspect" , [
975976 {" authorization" , " bearer 401" }], []).
976977
978+ idp_introspect_opaque_token (Config ) ->
979+ URI = rabbit_mgmt_test_util :uri_base_from (Config , 0 , " " ) ++ " js/oidc-oauth/bootstrap.js" ,
980+ Result = httpc :request (get , {URI , [{" Authorization" , " bearer active" }]}, [], []),
981+ ct :log (" response idp: ~p ~p " , [URI , Result ]).
982+
977983
978984% % -------------------------------------------------------------------
979985% % Utility/helper functions
0 commit comments