19
19
use Magento \AdobeImsApi \Api \OrganizationMembershipInterface ;
20
20
use Magento \Framework \App \RequestInterface ;
21
21
use Magento \Framework \Exception \AuthenticationException ;
22
+ use Magento \Framework \Exception \AuthorizationException ;
22
23
23
24
/**
24
25
* Adobe IMS Auth Model for getting Admin Token
@@ -68,7 +69,7 @@ class AdobeImsAdminTokenUserService
68
69
/**
69
70
* @var TokenResponseInterfaceFactory
70
71
*/
71
- private $ tokenResponseFactory ;
72
+ private TokenResponseInterfaceFactory $ tokenResponseFactory ;
72
73
73
74
/**
74
75
* @param ImsConfig $adminImsConfig
@@ -107,7 +108,7 @@ public function __construct(
107
108
* @return void
108
109
* @throws AdobeImsAuthorizationException
109
110
* @throws AdobeImsOrganizationAuthorizationException
110
- * @throws AuthenticationException
111
+ * @throws AuthenticationException|AuthorizationException
111
112
*/
112
113
public function processLoginRequest (bool $ isReauthorize = false ): void
113
114
{
@@ -141,10 +142,10 @@ public function processLoginRequest(bool $isReauthorize = false): void
141
142
/**
142
143
* Get requested token using Authorization header
143
144
*
144
- * @return \Magento\AdobeImsApi\Api\Data\ TokenResponseInterface
145
+ * @return TokenResponseInterface
145
146
* @throws AuthenticationException
146
147
*/
147
- private function getRequestedToken ()
148
+ private function getRequestedToken (): TokenResponseInterface
148
149
{
149
150
$ authorizationHeaderValue = $ this ->request ->getHeader ('Authorization ' );
150
151
if (!$ authorizationHeaderValue ) {
@@ -171,9 +172,11 @@ private function getRequestedToken()
171
172
* @param bool $isReauthorize
172
173
* @param TokenResponseInterface $tokenResponse
173
174
* @return void
175
+ * @throws AdobeImsAuthorizationException
174
176
* @throws AuthenticationException
177
+ * @throws AuthorizationException
175
178
*/
176
- private function getLoggedIn (bool $ isReauthorize , TokenResponseInterface $ tokenResponse )
179
+ private function getLoggedIn (bool $ isReauthorize , TokenResponseInterface $ tokenResponse ): void
177
180
{
178
181
$ profile = $ this ->profile ->getProfile ($ tokenResponse ->getAccessToken ());
179
182
if (empty ($ profile ['email ' ])) {
0 commit comments