@@ -1030,7 +1030,14 @@ introspect_opaque_token_returns_401_from_auth_server(Config) ->
1030
1030
oauth_bootstrap_with_jwt_token_in_header (Config ) ->
1031
1031
URI = rabbit_mgmt_test_util :uri_base_from (Config , 0 , " " ) ++ " js/oidc-oauth/bootstrap.js" ,
1032
1032
Result = httpc :request (get , {URI , [{" Authorization" , " bearer active" }]}, [], []),
1033
- ct :log (" response idp: ~p ~p " , [URI , Result ]).
1033
+ {ok , {{_HTTP , 200 , _ }, _Headers , ResBody }} = Result ,
1034
+ ct :log (" resbody: ~p " , [ResBody ]),
1035
+ case string :find (ResBody ," set_token_auth(" ) of
1036
+ nomatch -> ct :fail (" expected setting token" );
1037
+ Reminder ->
1038
+ {match , [Token | _ ]} = re :run (Reminder , " '([^']*)'" , [{capture , [1 ], list }]),
1039
+ ? assertEqual (true , oauth2_client :is_jwt_token (Token ))
1040
+ end .
1034
1041
1035
1042
oauth_bootstrap_with_jwt_token_in_cookie (Config ) ->
1036
1043
URI = rabbit_mgmt_test_util :uri_base_from (Config , 0 , " " ) ++ " js/oidc-oauth/bootstrap.js" ,
@@ -1044,13 +1051,16 @@ oauth_bootstrap_with_opaque_token_in_cookie(Config) ->
1044
1051
1045
1052
oauth_bootstrap_cannot_introspect_opaque_token (Config ) ->
1046
1053
URI = rabbit_mgmt_test_util :uri_base_from (Config , 0 , " " ) ++ " js/oidc-oauth/bootstrap.js" ,
1047
- Result = httpc : request ( get , {URI , [{ " Authorization " , " bearer active " }]}, [], []),
1048
- ct : log ( " response idp: ~p ~p " , [URI , Result ]).
1054
+ { ok , {{ _HTTP , 401 , _ }, _Headers , _ResBody }} =
1055
+ httpc : request ( get , { URI , [{ " Authorization " , " bearer inactive " }]} , [], [ ]).
1049
1056
1050
1057
oauth_bootstrap_without_any_token (Config ) ->
1051
1058
URI = rabbit_mgmt_test_util :uri_base_from (Config , 0 , " " ) ++ " js/oidc-oauth/bootstrap.js" ,
1052
- Result = httpc :request (get , {URI , [{" Authorization" , " bearer active" }]}, [], []),
1053
- ct :log (" response idp: ~p ~p " , [URI , Result ]).
1059
+ {ok , {{_HTTP , 200 , _ }, _Headers , ResBody }} = httpc :request (get , {URI , []}, [], []),
1060
+ case string :find (ResBody ," set_token_auth(" ) of
1061
+ nomatch -> ok ;
1062
+ Reminder -> ct :fail (" expected no set_token_auth call" )
1063
+ end .
1054
1064
1055
1065
1056
1066
% % -------------------------------------------------------------------
0 commit comments