This repository was archived by the owner on May 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
android/src/main/java/com/reactnativemsal Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2525import com .microsoft .identity .client .AuthenticationCallback ;
2626import com .microsoft .identity .client .IAccount ;
2727import com .microsoft .identity .client .IAuthenticationResult ;
28+ import com .microsoft .identity .client .IMultiTenantAccount ;
2829import com .microsoft .identity .client .IMultipleAccountPublicClientApplication ;
2930import com .microsoft .identity .client .Prompt ;
3031import com .microsoft .identity .client .PublicClientApplication ;
@@ -394,7 +395,11 @@ private WritableMap msalResultToDictionary(@NonNull IAuthenticationResult result
394395 WritableMap map = Arguments .createMap ();
395396 map .putString ("accessToken" , result .getAccessToken ());
396397 map .putString ("expiresOn" , String .format ("%s" , result .getExpiresOn ().getTime () / 1000 ));
397- map .putString ("idToken" , result .getAccount ().getIdToken ());
398+ String idToken = result .getAccount ().getIdToken ();
399+ if (idToken ==null ){
400+ idToken = ((IMultiTenantAccount ) result .getAccount ()).getTenantProfiles ().get (result .getTenantId ()).getIdToken ();
401+ }
402+ map .putString ("idToken" , idToken );
398403 map .putArray ("scopes" , Arguments .fromArray (result .getScope ()));
399404 map .putString ("tenantId" , result .getTenantId ());
400405 map .putMap ("account" , accountToMap (result .getAccount ()));
You can’t perform that action at this time.
0 commit comments