@@ -38,7 +38,7 @@ public function create(object $resource, UserInterface $owner, array $context =
3838 );
3939
4040 // create resource_set on OIDC server
41- $ this ->securityAuthorizationClient ->request ('POST ' , $ this -> getResourceRegistrationEndpoint () , [
41+ $ this ->securityAuthorizationClient ->request ('POST ' , ' authz/protection/resource_set ' , [
4242 'auth_bearer ' => $ this ->getPAT (),
4343 'json ' => [
4444 'name ' => \sprintf ('%s_%s ' , $ shortName , $ resource ->getId ()->__toString ()),
@@ -66,7 +66,7 @@ public function delete(object $resource, UserInterface $owner, array $context =
6666 // retrieve corresponding resource_set from OIDC server
6767 $ response = $ this ->securityAuthorizationClient ->request (
6868 'GET ' ,
69- $ this -> getResourceRegistrationEndpoint () ,
69+ ' authz/protection/resource_set ' ,
7070 [
7171 'auth_bearer ' => $ this ->getPAT (),
7272 'query ' => [
@@ -85,7 +85,7 @@ public function delete(object $resource, UserInterface $owner, array $context =
8585 // delete corresponding resource_set on OIDC server
8686 $ this ->securityAuthorizationClient ->request (
8787 'DELETE ' ,
88- \sprintf ('%s/%s ' , $ this -> getResourceRegistrationEndpoint () , $ resourceSet ['_id ' ]),
88+ \sprintf ('%s/%s ' , ' authz/protection/resource_set ' , $ resourceSet ['_id ' ]),
8989 [
9090 'auth_bearer ' => $ this ->getPAT (),
9191 ]
@@ -97,7 +97,7 @@ public function delete(object $resource, UserInterface $owner, array $context =
9797 */
9898 private function getPAT (): string
9999 {
100- $ response = $ this ->securityAuthorizationClient ->request ('POST ' , $ this -> getTokenEndpoint () , [
100+ $ response = $ this ->securityAuthorizationClient ->request ('POST ' , ' protocol/openid-connect/token ' , [
101101 'body ' => [
102102 'grant_type ' => 'client_credentials ' ,
103103 'client_id ' => $ this ->oidcClientId ,
@@ -108,20 +108,4 @@ private function getPAT(): string
108108
109109 return $ content ['access_token ' ];
110110 }
111-
112- private function getTokenEndpoint (): string
113- {
114- $ response = $ this ->securityAuthorizationClient ->request ('GET ' , '.well-known/openid-configuration ' );
115- $ content = $ response ->toArray ();
116-
117- return $ content ['token_endpoint ' ];
118- }
119-
120- private function getResourceRegistrationEndpoint (): string
121- {
122- $ response = $ this ->securityAuthorizationClient ->request ('GET ' , '.well-known/uma2-configuration ' );
123- $ content = $ response ->toArray ();
124-
125- return $ content ['resource_registration_endpoint ' ];
126- }
127111}
0 commit comments