@@ -54,7 +54,8 @@ groups() ->
54
54
{verify_introspection_endpoint , [], [
55
55
introspect_opaque_token_returns_active_jwt_token ,
56
56
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
58
59
]}
59
60
]},
60
61
{verify_multi_resource_and_provider , [], [
@@ -697,7 +698,9 @@ end_per_group(_, Config) ->
697
698
698
699
init_per_testcase (Testcase , Config ) when Testcase =:= introspect_opaque_token_returns_active_jwt_token orelse
699
700
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
+
701
704
ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , set_env ,
702
705
[rabbitmq_auth_backend_oauth2 , introspection_endpoint ,
703
706
? config (authorization_server_url , Config )]),
@@ -721,7 +724,8 @@ init_per_testcase(Testcase, Config) ->
721
724
722
725
end_per_testcase (Testcase , Config ) when Testcase =:= introspect_opaque_token_returns_active_jwt_token orelse
723
726
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 ->
725
729
ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , unset_env ,
726
730
[rabbitmq_auth_backend_oauth2 , introspection_endpoint ]),
727
731
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) ->
958
962
959
963
introspect_opaque_token_returns_active_jwt_token (Config ) ->
960
964
{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" }], []).
965
966
966
967
introspect_opaque_token_returns_inactive_jwt_token (Config ) ->
967
968
{ok , {{_HTTP , 401 , _ }, _Headers , ResBody }} = req (Config , 0 , post , " /auth/introspect" , [
968
969
{" 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 )),
970
971
? assertEqual (<<" not_authorised" >>, maps :get (<<" error" >>, JSON )),
971
972
? assertEqual (<<" Introspected token is not active" >>, maps :get (<<" reason" >>, JSON )).
972
973
973
974
introspect_opaque_token_returns_401_from_auth_server (Config ) ->
974
975
{ok , {{_HTTP , 401 , _ }, _Headers , _ResBody }} = req (Config , 0 , post , " /auth/introspect" , [
975
976
{" authorization" , " bearer 401" }], []).
976
977
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
+
977
983
978
984
% % -------------------------------------------------------------------
979
985
% % Utility/helper functions
0 commit comments