Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #110 from UN-ICC/fix_guest_tenant_user_login
Browse files Browse the repository at this point in the history
  • Loading branch information
josmithua authored Oct 28, 2021
2 parents 97a8503 + 2bb5727 commit 9aa35da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion android/src/main/java/com/reactnativemsal/RNMSALModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.microsoft.identity.client.AuthenticationCallback;
import com.microsoft.identity.client.IAccount;
import com.microsoft.identity.client.IAuthenticationResult;
import com.microsoft.identity.client.IMultiTenantAccount;
import com.microsoft.identity.client.IMultipleAccountPublicClientApplication;
import com.microsoft.identity.client.Prompt;
import com.microsoft.identity.client.PublicClientApplication;
Expand Down Expand Up @@ -394,7 +395,11 @@ private WritableMap msalResultToDictionary(@NonNull IAuthenticationResult result
WritableMap map = Arguments.createMap();
map.putString("accessToken", result.getAccessToken());
map.putString("expiresOn", String.format("%s", result.getExpiresOn().getTime() / 1000));
map.putString("idToken", result.getAccount().getIdToken());
String idToken = result.getAccount().getIdToken();
if (idToken==null){
idToken = ((IMultiTenantAccount) result.getAccount()).getTenantProfiles().get(result.getTenantId()).getIdToken();
}
map.putString("idToken", idToken);
map.putArray("scopes", Arguments.fromArray(result.getScope()));
map.putString("tenantId", result.getTenantId());
map.putMap("account", accountToMap(result.getAccount()));
Expand Down

0 comments on commit 9aa35da

Please sign in to comment.