Skip to content

Commit c0d7031

Browse files
authored
Pass Work Profile existence, OS Version, and Manufacturer to ESTS, Fixes AB#3138815 (#2627)
Feature Spec: https://microsoft-my.sharepoint-df.com/:w:/p/jukollin/EW3bntSipC1Ek8gY7sIX_yUBXip16NxHN-mge53O1V0K7Q?e=vxoEue Contract with ESTS for query parameter names: https://microsoft-my.sharepoint-df.com/:w:/r/personal/fadidurah_microsoft_com/_layouts/15/doc2.aspx?sourcedoc=%7B7F727CCE-ECB4-4790-B4B9-369B8BD14A5D%7D&file=Document.docx&action=editnew&mobileredirect=true&wdPreviousSession=640fdd8a-c8fd-4983-fd56-29908be02022&wdNewAndOpenCt=1740713103250&wdo=4&wdOrigin=TEAMS-MAGLEV.p2p_ns.rwc&wdPreviousCorrelation=3a1b8576-c30c-4b46-9f9e-7cfde7fb9cbe&wdnd=1&wdTpl=blankNew&share=IQHOfHJ_tOyQR7S5NpuL0UpdAYK9OGBqj-cKpGfw7kJbcPk&wdExp=TEAMS-TREATMENT&wdhostclicktime=1744341352978&web=1 Msal-only Authorize request: /login.microsoftonline.com/organizations/oAuth2/v2.0/authorize?prompt=select_account&client-request-id=de149d0e-9a9e-4f42-accf-c43e209b1b35&x-client-CPU=arm64-v8a&x-client-DM=Pixel&**x-client-MN=Google**&**x-client-OS=29**&x-client-SKU=MSAL.Android&x-client-Ver=5.10.0&login_hint=&instance_aware=false&code_challenge=8sy252i6gSVaCyONbgVYS9qhatnWyybwGzqs35bPwYQ&code_challenge_method=S256&**x-client-WPAvailable=true**&claims=%7B%7D&client_id=4b0db8c2-9f26-4417-8bde-3f0e3656f8e0&redirect_uri=msauth%3A%2F%2Fcom.msft.identity.client.sample.local%2F1wIqXSqBj7w%252Bh11ZifsnqwgyKrY%253D&response_type=code&scope=user.read%20%20openid%20offline_access%20profile&state=NzM6ZmIzZWFkZTctNDRmNC00YjBkLWEzODItOGVhYzc2ZTlkM2E1LWRiNmNlMzg2LTQ2NzktNGE2Ni1hMWVhLTk0Y2IzYmQ1NWJlZg Msal-broker Authorize request: /login.microsoftonline.com/organizations/oAuth2/v2.0/authorize?prompt=login&client-request-id=ef4e33b5-b8ae-45e9-a9ff-d0ea51487db2&x-client-CPU=arm64-v8a&x-client-DM=Pixel&**x-client-MN=Google**&**x-client-OS=29**&x-client-SKU=MSAL.Android&x-client-Ver=6.0.0&login_hint=&instance_aware=true&code_challenge=rax8IWFnE_OtZlr1p7GKgWZk9cF2gl6o1fGKS3gmx5U&code_challenge_method=S256&**x-client-WPAvailable=true**&client_id=29d9ed98-a469-4536-ade2-f981bc1d605e&redirect_uri=msauth%3A%2F%2FMicrosoft.AAD.BrokerPlugin&response_type=code&scope=aza%20openid%20email%20profile%20offline_access%20urn%3Aaad%3Atb%3Aupdate%3Aprt%2F.default&state=MTI3OjVjNGIwMjFmLWM5NTYtNDk4Yy1iNTVhLThlNWVjZjcwZjg2OC03NzU2NjljOC05NTRhLTQ2MjktYjVlMC1kMmZiNDY5YWRhYWE&temp-param=Temporary&webauthn=1&brkr=1&x-client-brkrver=8.1.20250423-1ESdev.6&x-app-name=com.msft.identity.client.sample.local&x-app-ver=1.0-local&domain_hint=organizations&caller_app_client_id=4b0db8c2-9f26-4417-8bde-3f0e3656f8e0&caller_app_redirect_uri=msauth%3A%2F%2Fcom.msft.identity.client.sample.local%2F1wIqXSqBj7w%252Bh11ZifsnqwgyKrY%253D&prt_protocol_version=3.0 Note `x-client-MN=Google`, `x-client-OS=29`, and `x-client-WPAvailable=true` We were already passing OS version (x-client-OS), this PR makes changes to common to include Device manufacturer and an additional parameter denoting if we are making a request from personal profile, but a work profile managed by clouddpc (NOT MANAGED BY COMPANY PORTAL, the intent will not be found if work profile is managed by Company Portal). Validation: Manual validation done with JAmes, setup Android Enterprise work profile on test device, and was getting a success when querying for intent. Did this for MSAL, MSAL/Broker, and OneAuth/Broker. Separate work must be done to get these parameters sent in oneuath only scenarios [AB#3138815](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3138815)
1 parent a7e1e48 commit c0d7031

File tree

8 files changed

+221
-2
lines changed

8 files changed

+221
-2
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
vNext
22
----------
3+
- [MINOR] Pass Work Profile existence, OS Version, and Manufacturer to ESTS (#2627)
34
- [MINOR] Add telemetry for the switch browser protocol (#2612)
45

56
Version 21.0.0

common/src/main/java/com/microsoft/identity/common/components/AndroidPlatformComponentsFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.microsoft.identity.common.internal.providers.oauth2.AndroidTaskStateGenerator;
3737
import com.microsoft.identity.common.internal.ui.AndroidAuthorizationStrategyFactory;
3838
import com.microsoft.identity.common.internal.ui.browser.AndroidBrowserSelector;
39+
import com.microsoft.identity.common.internal.util.WorkProfileUtil;
3940
import com.microsoft.identity.common.java.WarningType;
4041
import com.microsoft.identity.common.java.interfaces.IPlatformComponents;
4142
import com.microsoft.identity.common.java.interfaces.PlatformComponents;
@@ -67,6 +68,10 @@ public static synchronized void initializeGlobalStates(@NonNull final Context co
6768
if (!sGlobalStateInitalized) {
6869
HttpCache.initialize(context);
6970
Device.setDeviceMetadata(new AndroidDeviceMetadata());
71+
72+
// Denotes whether or not request is from personal profile but device has a Work Profile Available
73+
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(
74+
WorkProfileUtil.checkIfIsInPersonalProfileButClouddpcWorkProfileAvailable(context));
7075
Logger.setAndroidLogger();
7176

7277
final File cacheDir = context.getCacheDir();
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// All rights reserved.
3+
//
4+
// This code is licensed under the MIT License.
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files(the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions :
12+
//
13+
// The above copyright notice and this permission notice shall be included in
14+
// all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
// THE SOFTWARE.
23+
package com.microsoft.identity.common.internal.util;
24+
25+
import android.content.Context;
26+
import android.content.Intent;
27+
import android.content.pm.ResolveInfo;
28+
import android.os.Build;
29+
30+
import com.microsoft.identity.common.logging.Logger;
31+
32+
import java.util.List;
33+
34+
import lombok.NonNull;
35+
36+
public class WorkProfileUtil {
37+
private static final String TAG = WorkProfileUtil.class.getSimpleName();
38+
39+
/**
40+
* Helper method to check if we are in personal profile but a work profile managed by clouddpc
41+
* is available.
42+
* <a href="https://developers.google.com/android/management/work-profile-detection#detect_if_the_device_has_a_work_profile">Google Docs for intent used</a>
43+
* @param context context needed to check for intent
44+
* @return true if called in personal profile and a work profile managed by clouddpc exists, false otherwise
45+
*/
46+
public static boolean checkIfIsInPersonalProfileButClouddpcWorkProfileAvailable(@NonNull final Context context) {
47+
try {
48+
final Intent intent = new Intent("com.google.android.apps.work.clouddpc.ACTION_DETECT_WORK_PROFILE");
49+
final List<ResolveInfo> activities = context.getPackageManager().queryIntentActivities(intent, 0);
50+
51+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
52+
return activities.stream()
53+
.anyMatch(
54+
(ResolveInfo resolveInfo) -> resolveInfo.isCrossProfileIntentForwarderActivity());
55+
} else {
56+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
57+
return activities.stream()
58+
.anyMatch(
59+
(ResolveInfo resolveInfo) -> resolveInfo.activityInfo.name.equals("com.android.internal.app.ForwardIntentToManagedProfile"));
60+
}
61+
}
62+
63+
return false;
64+
} catch (Exception e) {
65+
// If we run into exception for any reason, we'll just return false
66+
Logger.warn(TAG, "Received an exception while trying to check if clouddpc work profile is available: " + e.getMessage());
67+
return false;
68+
}
69+
}
70+
}

common4j/src/main/com/microsoft/identity/common/java/platform/Device.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public class Device {
5050

5151
private static IDeviceMetadata sDeviceMetadata;
5252

53+
/**
54+
* Denotes whether or not request is from personal profile but device has a Work Profile Available
55+
*/
56+
private static boolean sIsInPersonalProfileButClouddpcWorkProfileAvailable = false;
57+
5358
private static final ReentrantReadWriteLock sLock = new ReentrantReadWriteLock();
5459

5560
@GuardedBy("sLock")
@@ -73,6 +78,26 @@ public static void clearDeviceMetadata(){
7378
}
7479
}
7580

81+
@GuardedBy("sLock")
82+
public static void setIsInPersonalProfileButClouddpcWorkProfileAvailable(final boolean isWorkProfileAvailable) {
83+
sLock.writeLock().lock();
84+
try {
85+
sIsInPersonalProfileButClouddpcWorkProfileAvailable = isWorkProfileAvailable;
86+
} finally {
87+
sLock.writeLock().unlock();
88+
}
89+
}
90+
91+
@GuardedBy("sLock")
92+
public static boolean isInPersonalProfileButClouddpcWorkProfileAvailable() {
93+
sLock.readLock().lock();
94+
try {
95+
return sIsInPersonalProfileButClouddpcWorkProfileAvailable;
96+
} finally {
97+
sLock.readLock().unlock();
98+
}
99+
}
100+
76101
@NonNull
77102
@GuardedBy("sLock")
78103
public static Map<String, String> getPlatformIdParameters() {
@@ -84,10 +109,12 @@ public static Map<String, String> getPlatformIdParameters() {
84109
platformParameters.put(PlatformIdParameters.CPU_PLATFORM, sDeviceMetadata.getCpu());
85110
platformParameters.put(PlatformIdParameters.OS, sDeviceMetadata.getOsForEsts());
86111
platformParameters.put(PlatformIdParameters.DEVICE_MODEL, sDeviceMetadata.getDeviceModel());
112+
platformParameters.put(PlatformIdParameters.MANUFACTURER, sDeviceMetadata.getManufacturer());
87113
} else {
88114
platformParameters.put(PlatformIdParameters.CPU_PLATFORM, NOT_SET);
89115
platformParameters.put(PlatformIdParameters.OS, NOT_SET);
90116
platformParameters.put(PlatformIdParameters.DEVICE_MODEL, NOT_SET);
117+
platformParameters.put(PlatformIdParameters.MANUFACTURER, NOT_SET);
91118
}
92119

93120
return Collections.unmodifiableMap(platformParameters);
@@ -246,6 +273,11 @@ public static final class PlatformIdParameters {
246273
*/
247274
public static final String OS = "x-client-OS";
248275

276+
/**
277+
* The String representing the device Manufacturer.
278+
*/
279+
public static final String MANUFACTURER = "x-client-MN";
280+
249281
/**
250282
* The String representing the device model.
251283
*/

common4j/src/main/com/microsoft/identity/common/java/providers/microsoft/MicrosoftAuthorizationRequest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ public abstract class MicrosoftAuthorizationRequest<T extends MicrosoftAuthoriza
123123
@SerializedName("x-client-DM")
124124
private final String mDiagnosticDM;
125125

126+
@Expose()
127+
@Getter
128+
@Accessors(prefix = "m")
129+
@SerializedName("x-client-MN")
130+
private final String mDiagnosticMN;
131+
126132
@Expose()
127133
@Getter
128134
@Accessors(prefix = "m")
@@ -135,6 +141,12 @@ public abstract class MicrosoftAuthorizationRequest<T extends MicrosoftAuthoriza
135141
@SerializedName("pc")
136142
private final String mPreferredAuthMethodCode;
137143

144+
@Expose()
145+
@Getter
146+
@Accessors(prefix = "m")
147+
@SerializedName("x-client-WPAvailable")
148+
private final Boolean mWorkProfileAvailable;
149+
138150

139151
/**
140152
* Constructor of MicrosoftAuthorizationRequest.
@@ -162,6 +174,8 @@ protected MicrosoftAuthorizationRequest(@SuppressWarnings(WarningType.rawtype_wa
162174
mDiagnosticOS = Device.getOsForEsts();
163175
mDiagnosticDM = Device.getModel();
164176
mDiagnosticCPU = Device.getCpu();
177+
mDiagnosticMN = Device.getManufacturer();
178+
mWorkProfileAvailable = Device.isInPersonalProfileButClouddpcWorkProfileAvailable();
165179
}
166180

167181
public abstract static class Builder<B extends MicrosoftAuthorizationRequest.Builder<B>> extends AuthorizationRequest.Builder<B> {

common4j/src/test/com/microsoft/identity/common/java/platform/DeviceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ public void tearDown() {
5151
public void testGetDataWhenMetadataIsNotSet(){
5252
// Shouldn't crash.
5353
final Map<String, String> platformParameter = Device.getPlatformIdParameters();
54-
Assert.assertEquals(3, platformParameter.size());
54+
Assert.assertEquals(4, platformParameter.size());
5555
Assert.assertEquals(NOT_SET, platformParameter.get(Device.PlatformIdParameters.CPU_PLATFORM));
5656
Assert.assertEquals(NOT_SET, platformParameter.get(Device.PlatformIdParameters.DEVICE_MODEL));
5757
Assert.assertEquals(NOT_SET, platformParameter.get(Device.PlatformIdParameters.OS));
58+
Assert.assertEquals(NOT_SET, platformParameter.get(Device.PlatformIdParameters.MANUFACTURER));
5859

5960
Assert.assertEquals(NOT_SET, Device.getManufacturer());
6061
Assert.assertEquals(NOT_SET, Device.getModel());
@@ -66,10 +67,11 @@ public void testGetPlatformIdParameters(){
6667
Device.setDeviceMetadata(new MockDeviceMetadata());
6768

6869
final Map<String, String> platformParameter = Device.getPlatformIdParameters();
69-
Assert.assertEquals(3, platformParameter.size());
70+
Assert.assertEquals(4, platformParameter.size());
7071
Assert.assertEquals(MockDeviceMetadata.TEST_CPU, platformParameter.get(Device.PlatformIdParameters.CPU_PLATFORM));
7172
Assert.assertEquals(MockDeviceMetadata.TEST_DEVICE_MODEL, platformParameter.get(Device.PlatformIdParameters.DEVICE_MODEL));
7273
Assert.assertEquals(MockDeviceMetadata.TEST_OS_ESTS, platformParameter.get(Device.PlatformIdParameters.OS));
74+
Assert.assertEquals(MockDeviceMetadata.TEST_MANUFACTURER, platformParameter.get(Device.PlatformIdParameters.MANUFACTURER));
7375
}
7476

7577
@Test

common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/MicrosoftAuthorizationRequestTest.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class MicrosoftAuthorizationRequestTest {
4949
@After
5050
public void tearDown() {
5151
Device.clearDeviceMetadata();
52+
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(false);
5253
}
5354

5455
public static final String MOCK_AUTHORITY = "http://mock_authority";
@@ -85,13 +86,51 @@ public void testCreateUriFromAuthorizationRequest() throws MalformedURLException
8586
"&x-client-OS=" + MockDeviceMetadata.TEST_OS_ESTS +
8687
"&x-client-CPU=" + MockDeviceMetadata.TEST_CPU +
8788
"&x-client-DM=" + MockDeviceMetadata.TEST_DEVICE_MODEL +
89+
"&x-client-MN=" + MockDeviceMetadata.TEST_MANUFACTURER +
8890
"&instance_aware=" + MOCK_MULTIPLE_CLOUD_AWARE +
91+
"&x-client-WPAvailable=false" +
8992
// Base class fields start here.
9093
"&response_type=code" +
9194
"&state=" + MOCK_STATE_ENCODED,
9295
request.getAuthorizationRequestAsHttpRequest().toString());
9396
}
9497

98+
@Test
99+
public void testCreateUriFromAuthorizationRequestWithWPAvailable() throws MalformedURLException, ClientException {
100+
Device.setDeviceMetadata(new MockDeviceMetadata());
101+
102+
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(true);
103+
104+
final MockMicrosoftAuthorizationRequest request = new MockMicrosoftAuthorizationRequest.Builder()
105+
.setAuthority(new URL(MOCK_AUTHORITY))
106+
.setLibraryVersion(MOCK_LIBRARY_VERSION)
107+
.setLibraryName(MOCK_LIBRARY_NAME)
108+
.setMultipleCloudAware(MOCK_MULTIPLE_CLOUD_AWARE)
109+
.setCorrelationId(MOCK_CORRELATION_ID)
110+
.setLoginHint(MOCK_LOGIN_HINT)
111+
.setPkceChallenge(MOCK_PKCE_CHALLENGE)
112+
.setState(MOCK_STATE)
113+
.build();
114+
115+
Assert.assertEquals(MockAuthorizationRequest.MOCK_AUTH_ENDPOINT +
116+
"?login_hint=" + MOCK_LOGIN_HINT +
117+
"&client-request-id=" + MOCK_CORRELATION_ID +
118+
"&code_challenge=" + MOCK_PKCE_CHALLENGE.getCodeChallenge() +
119+
"&code_challenge_method=" + MOCK_PKCE_CHALLENGE.getCodeChallengeMethod() +
120+
"&x-client-Ver=" + MOCK_LIBRARY_VERSION +
121+
"&x-client-SKU=" + MOCK_LIBRARY_NAME +
122+
"&x-client-OS=" + MockDeviceMetadata.TEST_OS_ESTS +
123+
"&x-client-CPU=" + MockDeviceMetadata.TEST_CPU +
124+
"&x-client-DM=" + MockDeviceMetadata.TEST_DEVICE_MODEL +
125+
"&x-client-MN=" + MockDeviceMetadata.TEST_MANUFACTURER +
126+
"&instance_aware=" + MOCK_MULTIPLE_CLOUD_AWARE +
127+
"&x-client-WPAvailable=true" +
128+
// Base class fields start here.
129+
"&response_type=code" +
130+
"&state=" + MOCK_STATE_ENCODED,
131+
request.getAuthorizationRequestAsHttpRequest().toString());
132+
}
133+
95134
// If state is not provided, MicrosoftAuthorizationRequest should generate a default one.
96135
@Test
97136
public void testDefaultStateGenerated(){

common4j/src/test/com/microsoft/identity/common/java/providers/microsoft/microsoftsts/MicrosoftStsAuthorizationRequestTests.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public class MicrosoftStsAuthorizationRequestTests {
9595
@After
9696
public void tearDown() {
9797
Device.clearDeviceMetadata();
98+
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(false);
9899
}
99100

100101
static URL getValidRequestUrl() throws MalformedURLException {
@@ -139,6 +140,61 @@ public void testCreateUriFromAuthorizationRequest() throws MalformedURLException
139140
"&x-client-OS=" + MockDeviceMetadata.TEST_OS_ESTS +
140141
"&x-client-CPU=" + MockDeviceMetadata.TEST_CPU +
141142
"&x-client-DM=" + MockDeviceMetadata.TEST_DEVICE_MODEL +
143+
"&x-client-MN=" + MockDeviceMetadata.TEST_MANUFACTURER +
144+
"&x-client-WPAvailable=false" +
145+
"&response_type=code" +
146+
"&client_id=" + DEFAULT_TEST_CLIENT_ID +
147+
"&redirect_uri=" + DEFAULT_TEST_REDIRECT_URI_ENCODED +
148+
"&state=" + MOCK_STATE_ENCODED +
149+
"&scope=" + DEFAULT_TEST_SCOPE_ENCODED +
150+
"&" + MOCK_FLIGHT_QUERY_1 + "=" + MOCK_FLIGHT_VALUE_1 +
151+
"&" + MOCK_FLIGHT_QUERY_2 + "=" + MOCK_FLIGHT_VALUE_2 +
152+
"&slice=" + DEFAULT_TEST_SLICE_PARAMETER +
153+
"&dc=" + DEFAULT_TEST_DATA_CENTER,
154+
request.getAuthorizationRequestAsHttpRequest().toString());
155+
156+
Assert.assertEquals(DEFAULT_TEST_DISPLAYABLEID, request.getDisplayableId());
157+
}
158+
159+
@Test
160+
public void testCreateUriFromAuthorizationRequestWithWPAvailable() throws MalformedURLException, URISyntaxException, ClientException {
161+
Device.setDeviceMetadata(new MockDeviceMetadata());
162+
Device.setIsInPersonalProfileButClouddpcWorkProfileAvailable(true);
163+
164+
final MicrosoftStsAuthorizationRequest request = new MicrosoftStsAuthorizationRequest.Builder()
165+
.setPrompt(DEFAULT_TEST_PROMPT)
166+
.setUid(DEFAULT_TEST_UID)
167+
.setUtid(DEFAULT_TEST_UTID)
168+
.setInstalledCompanyPortalVersion(TEST_CP_VERSION)
169+
.setSlice(DEFAULT_TEST_SLICE)
170+
.setFlightParameters(DEFAULT_FLIGHT_PARAMETER)
171+
.setDisplayableId(DEFAULT_TEST_DISPLAYABLEID)
172+
173+
// Values from base class.
174+
.setCorrelationId(DEFAULT_TEST_CORRELATION_ID)
175+
.setPkceChallenge(MOCK_PKCE_CHALLENGE)
176+
.setAuthority(getValidRequestUrl())
177+
178+
.setClientId(DEFAULT_TEST_CLIENT_ID)
179+
.setRedirectUri(DEFAULT_TEST_REDIRECT_URI)
180+
.setState(MOCK_STATE)
181+
.setScope(DEFAULT_TEST_SCOPE)
182+
.build();
183+
184+
Assert.assertEquals(DEFAULT_TEST_AUTHORIZATION_ENDPOINT +
185+
"?prompt=" + DEFAULT_TEST_PROMPT +
186+
"&login_req=" + DEFAULT_TEST_UID +
187+
"&domain_req=" + DEFAULT_TEST_UTID +
188+
"&cpVersion=" + TEST_CP_VERSION +
189+
// Base class fields start here.
190+
"&client-request-id=" + DEFAULT_TEST_CORRELATION_ID +
191+
"&code_challenge=" + MOCK_PKCE_CHALLENGE.getCodeChallenge() +
192+
"&code_challenge_method=" + MOCK_PKCE_CHALLENGE.getCodeChallengeMethod() +
193+
"&x-client-OS=" + MockDeviceMetadata.TEST_OS_ESTS +
194+
"&x-client-CPU=" + MockDeviceMetadata.TEST_CPU +
195+
"&x-client-DM=" + MockDeviceMetadata.TEST_DEVICE_MODEL +
196+
"&x-client-MN=" + MockDeviceMetadata.TEST_MANUFACTURER +
197+
"&x-client-WPAvailable=true" +
142198
"&response_type=code" +
143199
"&client_id=" + DEFAULT_TEST_CLIENT_ID +
144200
"&redirect_uri=" + DEFAULT_TEST_REDIRECT_URI_ENCODED +

0 commit comments

Comments
 (0)