@@ -40,11 +40,11 @@ class ServerController extends Controller {
4040
4141 /* @var Pdsinterop\Solid\Auth\Factory\AuthorizationServerFactory */
4242 private $ authServerFactory ;
43-
43+
4444 /* @var Pdsinterop\Solid\Auth\TokenGenerator */
4545 private $ tokenGenerator ;
46-
47- public function __construct ($ AppName , IRequest $ request , ISession $ session , IUserManager $ userManager , IURLGenerator $ urlGenerator , $ userId , IConfig $ config , \OCA \Solid \Service \UserService $ UserService )
46+
47+ public function __construct ($ AppName , IRequest $ request , ISession $ session , IUserManager $ userManager , IURLGenerator $ urlGenerator , $ userId , IConfig $ config , \OCA \Solid \Service \UserService $ UserService )
4848 {
4949 parent ::__construct ($ AppName , $ request );
5050 require_once (__DIR__ .'/../../vendor/autoload.php ' );
@@ -55,8 +55,8 @@ public function __construct($AppName, IRequest $request, ISession $session, IUse
5555 $ this ->urlGenerator = $ urlGenerator ;
5656 $ this ->session = $ session ;
5757
58- $ this ->authServerConfig = $ this ->createAuthServerConfig ();
59- $ this ->authServerFactory = (new \Pdsinterop \Solid \Auth \Factory \AuthorizationServerFactory ($ this ->authServerConfig ))->create ();
58+ $ this ->authServerConfig = $ this ->createAuthServerConfig ();
59+ $ this ->authServerFactory = (new \Pdsinterop \Solid \Auth \Factory \AuthorizationServerFactory ($ this ->authServerConfig ))->create ();
6060 $ this ->tokenGenerator = (new \Pdsinterop \Solid \Auth \TokenGenerator ($ this ->authServerConfig ));
6161 }
6262
@@ -72,10 +72,10 @@ private function getOpenIdEndpoints() {
7272 "registration_endpoint " => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.server.register " ))
7373 ];
7474 }
75-
75+
7676 private function getKeys () {
7777 $ encryptionKey = $ this ->config ->getEncryptionKey ();
78- $ privateKey = $ this ->config ->getPrivateKey ();
78+ $ privateKey = $ this ->config ->getPrivateKey ();
7979 $ key = openssl_pkey_get_private ($ privateKey );
8080 $ publicKey = openssl_pkey_get_details ($ key )['key ' ];
8181 return [
@@ -84,7 +84,7 @@ private function getKeys() {
8484 "publicKey " => $ publicKey
8585 ];
8686 }
87-
87+
8888 private function createAuthServerConfig () {
8989 $ clientId = isset ($ _GET ['client_id ' ]) ? $ _GET ['client_id ' ] : null ;
9090 $ client = $ this ->getClient ($ clientId );
@@ -164,7 +164,7 @@ public function authorize() {
164164 }
165165 }
166166 $ clientId = $ getVars ['client_id ' ];
167- $ approval = $ this ->checkApproval ($ clientId );
167+ $ approval = $ this ->checkApproval ($ clientId );
168168 if (!$ approval ) {
169169 $ result = new JSONResponse ('Approval required ' );
170170 $ result ->setStatus (302 );
@@ -182,7 +182,7 @@ public function authorize() {
182182
183183 $ response = $ server ->respondToAuthorizationRequest ($ request , $ user , $ approval );
184184 $ response = $ this ->tokenGenerator ->addIdTokenToResponse ($ response , $ clientId , $ this ->getProfilePage (), $ this ->session ->get ("nonce " ), $ this ->config ->getPrivateKey ());
185-
185+
186186 return $ this ->respond ($ response ); // ->addHeader('Access-Control-Allow-Origin', '*');
187187 }
188188
@@ -200,7 +200,7 @@ private function checkApproval($clientId) {
200200 return \Pdsinterop \Solid \Auth \Enum \Authorization::DENIED ;
201201 }
202202 }
203-
203+
204204 private function getProfilePage () {
205205 return $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.profile.handleGet " , array ("userId " => $ this ->userId , "path " => "/card " ))) . "#me " ;
206206 }
@@ -228,7 +228,7 @@ private function getResponseType() {
228228 public function session () {
229229 return new JSONResponse ("ok " );
230230 }
231-
231+
232232 /**
233233 * @PublicPage
234234 * @NoAdminRequired
@@ -309,7 +309,7 @@ public function register() {
309309// ->addHeader('Access-Control-Allow-Origin', $origin)
310310// ->addHeader('Access-Control-Allow-Methods', 'POST');
311311 }
312-
312+
313313 /**
314314 * @PublicPage
315315 * @NoAdminRequired
@@ -320,7 +320,6 @@ public function registeredClient($clientId) {
320320 unset($ clientRegistration ['client_secret ' ]);
321321 return new JSONResponse ($ clientRegistration );
322322 }
323-
324323
325324 /**
326325 * @PublicPage
@@ -351,7 +350,7 @@ private function respond($response) {
351350 $ body = 'ok ' ;
352351 }
353352 $ result = new JSONResponse ($ body );
354-
353+
355354 foreach ($ headers as $ header => $ values ) {
356355 foreach ($ values as $ value ) {
357356 $ result ->addHeader ($ header , $ value );
0 commit comments