Skip to content

Commit c72e018

Browse files
committed
fixed issue with opening auth fragment when AcquireTokenParameters.Builder.withFragment method is used
1 parent 6843511 commit c72e018

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ V.Next
22
---------
33
- [PATCH] Add JWT header field for KDF version (#2220)
44
- [MINOR] Catch unknown Keystore errors during decryption (#2255)
5+
- [MINOR] Fixed issue with fragment displaying when 'AcquireTokenParameters.Builder().withFragment()' is used (#2274)
56

67
V.16.3.0
78
----------

common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AndroidAuthorizationStrategy.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected void launchIntent(@NonNull Intent intent) throws ClientException {
7878
final Fragment fragment = mReferencedFragment.get();
7979

8080
if (fragment != null) {
81-
final Fragment authFragment = AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntent(intent);
81+
final Fragment authFragment = getAuthorizationFragment(intent);
8282

8383
final FragmentManager fragmentManager = fragment.getFragmentManager();
8484
if (fragmentManager == null) {
@@ -98,4 +98,15 @@ protected void launchIntent(@NonNull Intent intent) throws ClientException {
9898
}
9999
activity.startActivity(intent);
100100
}
101+
102+
private static Fragment getAuthorizationFragment(@NonNull Intent intent) {
103+
if (intent.getExtras() != null) {
104+
return AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntentWithState(
105+
intent,
106+
intent.getExtras()
107+
);
108+
}
109+
110+
return AuthorizationActivityFactory.getAuthorizationFragmentFromStartIntent(intent);
111+
}
101112
}

0 commit comments

Comments
 (0)