@@ -104,7 +104,7 @@ public function showAuthPickerPage(string $clientIdentifier = '', string $user =
104104 $ client = null ;
105105 if ($ clientIdentifier !== '' ) {
106106 $ client = $ this ->clientMapper ->getByIdentifier ($ clientIdentifier );
107- $ clientName = $ client ->getName () ;
107+ $ clientName = $ client ->name ;
108108 }
109109
110110 // No valid clientIdentifier given and no valid API Request (APIRequest header not set)
@@ -134,7 +134,7 @@ public function showAuthPickerPage(string $clientIdentifier = '', string $user =
134134
135135 $ csp = new ContentSecurityPolicy ();
136136 if ($ client ) {
137- $ csp ->addAllowedFormActionDomain ($ client ->getRedirectUri () );
137+ $ csp ->addAllowedFormActionDomain ($ client ->redirectUri );
138138 } else {
139139 $ csp ->addAllowedFormActionDomain ('nc://* ' );
140140 }
@@ -191,12 +191,12 @@ public function grantPage(
191191 $ client = null ;
192192 if ($ clientIdentifier !== '' ) {
193193 $ client = $ this ->clientMapper ->getByIdentifier ($ clientIdentifier );
194- $ clientName = $ client ->getName () ;
194+ $ clientName = $ client ->name ;
195195 }
196196
197197 $ csp = new ContentSecurityPolicy ();
198198 if ($ client ) {
199- $ csp ->addAllowedFormActionDomain ($ client ->getRedirectUri () );
199+ $ csp ->addAllowedFormActionDomain ($ client ->redirectUri );
200200 } else {
201201 $ csp ->addAllowedFormActionDomain ('nc://* ' );
202202 }
@@ -274,7 +274,7 @@ public function generateAppPassword(
274274 $ client = false ;
275275 if ($ clientIdentifier !== '' ) {
276276 $ client = $ this ->clientMapper ->getByIdentifier ($ clientIdentifier );
277- $ clientName = $ client ->getName () ;
277+ $ clientName = $ client ->name ;
278278 }
279279
280280 $ token = $ this ->random ->generate (72 , ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS );
@@ -292,16 +292,16 @@ public function generateAppPassword(
292292 if ($ client ) {
293293 $ code = $ this ->random ->generate (128 , ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS );
294294 $ accessToken = new AccessToken ();
295- $ accessToken ->setClientId ( $ client ->getId ()) ;
296- $ accessToken ->setEncryptedToken ( $ this ->crypto ->encrypt ($ token , $ code) );
297- $ accessToken ->setHashedCode ( hash ('sha512 ' , $ code) );
298- $ accessToken ->setTokenId ( $ generatedToken ->getId () );
299- $ accessToken ->setCodeCreatedAt ( $ this ->timeFactory ->now ()->getTimestamp () );
295+ $ accessToken ->clientId = $ client ->id ;
296+ $ accessToken ->encryptedToken = $ this ->crypto ->encrypt ($ token , $ code );
297+ $ accessToken ->hashedCode = hash ('sha512 ' , $ code );
298+ $ accessToken ->tokenId = $ generatedToken ->getId ();
299+ $ accessToken ->codeCreatedAt = $ this ->timeFactory ->now ()->getTimestamp ();
300300 $ this ->accessTokenMapper ->insert ($ accessToken );
301301
302302 $ enableOcClients = $ this ->config ->getSystemValueBool ('oauth2.enable_oc_clients ' , false );
303303
304- $ redirectUri = $ client ->getRedirectUri () ;
304+ $ redirectUri = $ client ->redirectUri ;
305305 if ($ enableOcClients && $ redirectUri === 'http://localhost:* ' ) {
306306 // Sanity check untrusted redirect URI provided by the client first
307307 if (!preg_match ('/^http:\/\/localhost:[0-9]+$/ ' , $ providedRedirectUri )) {
0 commit comments