@@ -81,7 +81,7 @@ public function GetAccessTokens(OAuthRequestParameters $oauthRequestParameters,
8181
8282 $ OAuthTokenUrl = UriOAuthService::ENDPOINT_URLS [$ endpointType ]['OAuthTokenUrl ' ];
8383
84- if (( strcmp ( $ endpointType , OAuthEndpointType::ProductionMSIdentityV2) == 0 ) && (isset ($ tenant )))
84+ if (in_array ( $ endpointType , [ OAuthEndpointType::ProductionMSIdentityV2, OAuthEndpointType::ProductionMSIdentityV2_MSScope], true ) && (isset ($ tenant )))
8585 {
8686 $ OAuthTokenUrl = str_replace ("common " , $ tenant , $ OAuthTokenUrl );
8787 }
@@ -152,7 +152,7 @@ public static function GetAuthorizationEndpoint(OAuthUrlParameters $parameters,
152152
153153 $ authorizationEndpointUrl = UriOAuthService::ENDPOINT_URLS [$ endpointType ]['AuthorizationEndpointUrl ' ];
154154
155- if (( strcmp ( $ endpointType , OAuthEndpointType::ProductionMSIdentityV2) == 0 ) && (isset ($ tenant )))
155+ if (in_array ( $ endpointType , [ OAuthEndpointType::ProductionMSIdentityV2, OAuthEndpointType::ProductionMSIdentityV2_MSScope], true ) && (isset ($ tenant )))
156156 {
157157 $ authorizationEndpointUrl = str_replace ("common " , $ tenant , $ authorizationEndpointUrl );
158158 }
@@ -202,7 +202,7 @@ public static function GetAuthTokenUrl($environment, $oauthScope, $tenant) {
202202
203203 $ OAuthTokenUrl = UriOAuthService::ENDPOINT_URLS [$ endpointType ]['OAuthTokenUrl ' ];
204204
205- if (( strcmp ( $ endpointType , OAuthEndpointType::ProductionMSIdentityV2) == 0 ) && (isset ($ tenant )))
205+ if (in_array ( $ endpointType , [ OAuthEndpointType::ProductionMSIdentityV2, OAuthEndpointType::ProductionMSIdentityV2_MSScope], true ) && (isset ($ tenant )))
206206 {
207207 $ OAuthTokenUrl = str_replace ("common " , $ tenant , $ OAuthTokenUrl );
208208 }
@@ -215,7 +215,7 @@ public static function GetAuthorizeUrl($environment, $oauthScope, $tenant) {
215215
216216 $ authorizationEndpointUrl = UriOAuthService::ENDPOINT_URLS [$ endpointType ]['AuthorizationEndpointUrl ' ];
217217
218- if (( strcmp ( $ endpointType , OAuthEndpointType::ProductionMSIdentityV2) == 0 ) && (isset ($ tenant )))
218+ if (in_array ( $ endpointType , [ OAuthEndpointType::ProductionMSIdentityV2, OAuthEndpointType::ProductionMSIdentityV2_MSScope], true ) && (isset ($ tenant )))
219219 {
220220 $ authorizationEndpointUrl = str_replace ("common " , $ tenant , $ authorizationEndpointUrl );
221221 }
0 commit comments