Skip to content

Fix issue 1991: The acquireToken method doesn't work if the app uses "withFragmemt" #2595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ vNext
----------
- [MINOR] Launch browser when a switch_browser redirect URL is present (#2553)
- [MINOR] Add Broker Webapps operations api. (#2579)
- [MINOR] Fix issue 1991: The acquireToken method doesn't work if the app uses "withFragmemt" (#2595)

Version 20.0.0
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}
}
Loading