diff --git a/changelog.txt b/changelog.txt index b1fe40fc1a..013113c759 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ vNext - [PATCH] Translate MFA token error to UIRequiredException instead of ServiceException (#2538) - [MINOR] Add Child Spans for Interactive Span (#2516) - [MINOR] For MSAL CPP flows, match exact claims when deleting AT with intersecting scopes (#2548) +- [MINOR] Fix issue with fragment displaying when 'AcquireTokenParameters.Builder().withFragment()' is used (#2274) - [MINOR] Replace Deprecated Keystore API for Android 28+ (#2558) - [MINOR] Add support for OneBox Environment (#2559) - [MINOR] Managed profile Android util method (#2561) diff --git a/common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AndroidAuthorizationStrategy.java b/common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AndroidAuthorizationStrategy.java index 5a246540a5..00c330fa47 100644 --- a/common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AndroidAuthorizationStrategy.java +++ b/common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AndroidAuthorizationStrategy.java @@ -78,7 +78,7 @@ protected void launchIntent(@NonNull Intent intent) throws ClientException { final Fragment fragment = mReferencedFragment.get(); if (fragment != null) { - final Fragment authFragment = AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntent(intent); + final Fragment authFragment = getAuthorizationFragment(intent); final FragmentManager fragmentManager = fragment.getFragmentManager(); if (fragmentManager == null) { @@ -98,4 +98,15 @@ protected void launchIntent(@NonNull Intent intent) throws ClientException { } activity.startActivity(intent); } + + private static Fragment getAuthorizationFragment(@NonNull Intent intent) { + if (intent.getExtras() != null) { + return AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntentWithState( + intent, + intent.getExtras() + ); + } + + return AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntent(intent); + } }