Skip to content

Commit b783ffa

Browse files
Revert "feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint" (#2425)
Co-authored-by: Richard McClellan <[email protected]>
1 parent 0282118 commit b783ffa

File tree

3 files changed

+2
-117
lines changed

3 files changed

+2
-117
lines changed

aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUserPool.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ public CognitoUserPool(Context context, String userPoolId, String clientId, Stri
274274
this.pinpointEndpointId = CognitoPinpointSharedContext.getPinpointEndpoint(context, pinpointAppId);
275275
}
276276

277+
277278
/**
278279
* Constructs a user-pool with default {@link ClientConfiguration}.
279280
*
@@ -302,37 +303,15 @@ public CognitoUserPool(Context context, String userPoolId, String clientId, Stri
302303
* @param pinpointAppId REQUIRED: AWS Pinpoint App Id for analytics.
303304
*/
304305
public CognitoUserPool(Context context, String userPoolId, String clientId, String clientSecret, AmazonCognitoIdentityProvider client, String pinpointAppId) {
305-
this(context, userPoolId, clientId, clientSecret, client, pinpointAppId, null);
306-
}
307-
308-
/**
309-
* Constructs a user-pool with custom endpoint for Cognito User Pool
310-
*
311-
* @param context REQUIRED: Android application context.
312-
* @param userPoolId REQUIRED: User-pool-Id of the user-pool.
313-
* @param clientId REQUIRED: Client-Id generated for this app and user-pool at the
314-
* Cognito Identity Provider developer console.
315-
* @param clientSecret REQUIRED: Client Secret generated for this app and user-pool at
316-
* the Cognito Identity Provider developer console.
317-
* @param pinpointAppId REQUIRED: AWS Pinpoint App Id for analytics.
318-
* @param cognitoUserPoolCustomEndpoint REQUIRED: Custom endpoint for Cognito Userpool
319-
*/
320-
public CognitoUserPool(Context context, String userPoolId, String clientId, String clientSecret, AmazonCognitoIdentityProvider client, String pinpointAppId, String cognitoUserPoolCustomEndpoint) {
321306
initialize(context);
322307
this.context = context;
323308
this.userPoolId = userPoolId;
324309
this.clientId = clientId;
325310
this.clientSecret = clientSecret;
326311
this.client = client;
327312
this.pinpointEndpointId = CognitoPinpointSharedContext.getPinpointEndpoint(context, pinpointAppId);
328-
329-
// check if the custom endpoint is not empty
330-
if(cognitoUserPoolCustomEndpoint != null && !cognitoUserPoolCustomEndpoint.isEmpty()) {
331-
this.client.setEndpoint(cognitoUserPoolCustomEndpoint);
332-
}
333313
}
334314

335-
336315
private void initialize(final Context context) {
337316
this.awsKeyValueStore = new AWSKeyValueStore(context,
338317
DEFAULT_SHARED_PREFERENCES_NAME,

aws-android-sdk-cognitoidentityprovider/src/test/java/CognitoIdentityProviderCustomEndPointTest.java

Lines changed: 0 additions & 87 deletions
This file was deleted.

aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/AWSMobileClient.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,6 @@ public final class AWSMobileClient implements AWSCredentialsProvider {
189189
private static final String FACEBOOK = "FacebookSignIn";
190190
private static final String GOOGLE = "GoogleSignIn";
191191
private static final String GOOGLE_WEBAPP_CONFIG_KEY = "ClientId-WebApp";
192-
193-
/**
194-
* Configuration key for Cognito User Pool Custom Endpoint
195-
*/
196-
private static final String COGNITO_USERPOOL_CUSTOM_ENDPOINT = "Endpoint";
197-
198192
/**
199193
* Singleton instance for AWSMobileClient.
200194
*/
@@ -563,7 +557,6 @@ public void onUserSignedOut() {
563557
final String clientId = userPoolJSON.getString("AppClientId");
564558
final String clientSecret = userPoolJSON.optString("AppClientSecret");
565559
final String pinpointEndpointId = CognitoPinpointSharedContext.getPinpointEndpoint(context, userPoolJSON.optString("PinpointAppId"));
566-
final String cognitoUserPoolCustomEndpoint = userPoolJSON.optString(COGNITO_USERPOOL_CUSTOM_ENDPOINT);
567560

568561
final ClientConfiguration clientConfig = new ClientConfiguration();
569562
clientConfig.setUserAgent(DEFAULT_USER_AGENT + " " + awsConfiguration.getUserAgent());
@@ -576,7 +569,7 @@ public void onUserSignedOut() {
576569

577570
userpoolsLoginKey = String.format("cognito-idp.%s.amazonaws.com/%s", userPoolJSON.getString("Region"), userPoolJSON.getString("PoolId"));
578571

579-
userpool = new CognitoUserPool(mContext, mUserPoolPoolId, clientId, clientSecret, userpoolLL, pinpointEndpointId, cognitoUserPoolCustomEndpoint);
572+
userpool = new CognitoUserPool(mContext, mUserPoolPoolId, clientId, clientSecret, userpoolLL, pinpointEndpointId);
580573
userpool.setPersistenceEnabled(mIsPersistenceEnabled);
581574

582575
mDeviceOperations = new DeviceOperations(AWSMobileClient.this, userpoolLL);

0 commit comments

Comments
 (0)