Skip to content

Commit 1940e05

Browse files
jamesonwilliamsdiv5yeshthisisabhashawsmobilesdkrichardmcclellan
authored
feat: revoke tokens during auth sign out (#2415)
* feature: user pool token revocation model updates * feature: revoke tokens if invalidate tokens specified * Token revocation (#2532) * feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint * feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint unit tests * feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint unit tests * feat(aws-android-sdk-machinelearning): update models to latest (#2407) Co-authored-by: Richard McClellan <[email protected]> * feat(aws-android-sdk-iot): update models to latest (#2408) Co-authored-by: Richard McClellan <[email protected]> * feat(aws-android-sdk-comprehend): update models to latest (#2409) Co-authored-by: Richard McClellan <[email protected]> * feat(aws-android-sdk-transcribe): update models to latest (#2410) Co-authored-by: Richard McClellan <[email protected]> * feat(aws-android-sdk-lex): update models to latest (#2413) Co-authored-by: Richard McClellan <[email protected]> * chore(lex): update service name for lex runtime (#2424) * feat(aws-android-sdk-kinesisvideo-archivedmedia): update models to latest (#2422) * Revert "feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint" (#2425) Co-authored-by: Richard McClellan <[email protected]> * release: 2.22.6 (#2426) * fix(mobile-client): missing optional dependency warning removed (#2427) * fix(mobile-client): missing optional dependency warning removed * make comment more descriptive * chore: add fastlane scripts for release automation (#2428) * fix: change protocol for github import (#2429) * fix(s3): remove eTag validation logic (#2419) * chore(build): use in-memory key in CI (#2449) * change the time offset precision from int to long (#2448) **Notes:** The clockskew auto-correct logic in the SDK relies on the `int` primitive type when calculating the offset. When the offset is converted from milliseconds to days, the ms represented as an `int` have the boundaries as -24 and +24 days. Changing it to long (64-bit precision) fixes the limit. * fix(s3): force upload part tasks to be serial (#2447) * feat(aws-android-sdk-core): update models to latest (#2445) Co-authored-by: Richard McClellan <[email protected]> * release: AWS SDK for Android 2.22.7 (#2451) * release: AWS SDK for Android 2.23.0 * Update CHANGELOG.md Co-authored-by: Richard McClellan <[email protected]> * Update CHANGELOG.md * Update gradle.properties * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> Co-authored-by: Chang Xu <[email protected]> Co-authored-by: Richard McClellan <[email protected]> * "feat(aws-android-sdk-cognitoidentityprovider): support custom endpoint" (#2455) * fix(pinpoint): add campaign attributes to push events (#2458) * release: AWS SDK for Android 2.23.0 (#2459) * release: AWS SDK for Android 2.22.8 * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * Update gradle.properties Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> Co-authored-by: Chang Xu <[email protected]> * feat(aws-android-sdk-sns): update models to latest (#2461) * feat(aws-android-sdk-cognitoidentityprovider): update models to latest (#2456) Co-authored-by: Raphael Kim <[email protected]> * chore(build): set region in circleci script (#2467) * fix: launch hosted-ui sign-out using custom tabs manager (#2472) * feat(mobile-client): hosted-ui auth response handler is now built into redirect activity (#2473) * feat(mobile-client): auth response handler is now built into redirect activity * add javadocs for redirect activities * add signout latch conditionally * add no history flag to auth signout flow * feat(aws-android-sdk-connect): update models to latest (#2469) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-transcribe): update models to latest (#2476) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-rekognition): update models to latest (#2487) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-iot): update models to latest (#2490) Co-authored-by: Raphael Kim <[email protected]> Co-authored-by: Rafael Juliano <[email protected]> * feat(aws-android-sdk-location): update models to latest (#2494) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-sns): update models to latest (#2496) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-polly): update models to latest (#2497) Co-authored-by: Raphael Kim <[email protected]> * chore(sts): add support for regionalizing sts client (#2493) * feat(sts): add support for regionalizing sts client * feat(aws-android-sdk-mobile-client): adds signature with user attributes in confirmSignIn (#2492) * feat(aws-android-sdk-mobile-client): adds signature with user attributes in confirmSignIn * code review suggestion Co-authored-by: Noyes <[email protected]> * release: AWS SDK for Android 2.24.0 (#2500) * release: AWS SDK for Android 2.24.0 * Reword the changelog * include instruction for applying fix Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> Co-authored-by: Raphael Kim <[email protected]> * fix(aws-android-sdk-lex): prioritize custom lex signer for all regions (#2506) * fix(aws-android-sdk-lex): prioritize custom lex signer for all regions * add tests * fix(mobileclient): Honor auth flow setting from config (#2499) * fix(mobileclient): Honor auth flow setting from config * PR feedback * fix(aws-android-sdk-polly): use correct SignerConfig in all regions (#2505) Co-authored-by: Raphael Kim <[email protected]> * feat(aws-android-sdk-cognitoidentityprovider): update models to latest (#2510) * release: AWS SDK for Android 2.25.0 (#2512) Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> * chore(docs): releases not pushed to S3 anymore (#2514) * fix(aws-android-sdk-s3): implement retry mechanism for upload part (#2504) * implement retry mechanism for upload part * reduce backoff time and max attempts * lgtm warning * feat(aws-android-sdk-connect): update models to latest (#2516) * feat(aws-android-sdk-kms): update models to latest (#2518) * release: AWS SDK for Android 2.26.0 (#2525) Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> * feat(aws-android-sdk-connect): update models to latest (#2526) Co-authored-by: Abhash Kumar Singh <[email protected]> Co-authored-by: Abhash Kumar Singh <[email protected]> Co-authored-by: Jameson Williams <[email protected]> Co-authored-by: AWS Mobile SDK Team <[email protected]> Co-authored-by: Richard McClellan <[email protected]> Co-authored-by: Raphael Kim <[email protected]> Co-authored-by: Rafael Juliano <[email protected]> Co-authored-by: Daniel Rochetti <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> Co-authored-by: Chang Xu <[email protected]> Co-authored-by: Dustin Noyes <[email protected]> Co-authored-by: Noyes <[email protected]> Co-authored-by: tllauda <[email protected]> * Update UserPoolClientType.java remove duplicate vars. * delete code for removed API * fixes: - use access token to check claim - check for origin_jti claim - clientSecret is optional * Update aws-android-sdk-cognitoidentityprovider/src/main/java/com/amazonaws/mobileconnectors/cognitoidentityprovider/CognitoUser.java Co-authored-by: Richard McClellan <[email protected]> * swallow exceptions * update test mock classes with latest model changes * add unit tests * return revoketoken response result Co-authored-by: Divyesh Chitroda <[email protected]> Co-authored-by: Abhash Kumar Singh <[email protected]> Co-authored-by: Abhash Kumar Singh <[email protected]> Co-authored-by: AWS Mobile SDK Team <[email protected]> Co-authored-by: Richard McClellan <[email protected]> Co-authored-by: Raphael Kim <[email protected]> Co-authored-by: Rafael Juliano <[email protected]> Co-authored-by: Daniel Rochetti <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: awsmobilesdk-dev+ghops <[email protected]> Co-authored-by: Chang Xu <[email protected]> Co-authored-by: Dustin Noyes <[email protected]> Co-authored-by: Noyes <[email protected]> Co-authored-by: tllauda <[email protected]> Co-authored-by: poojamat <[email protected]>
1 parent 783d43d commit 1940e05

File tree

7 files changed

+227
-0
lines changed

7 files changed

+227
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.amazonaws.mobileconnectors.cognitoidentityprovider.tokens.CognitoIdToken;
4646
import com.amazonaws.mobileconnectors.cognitoidentityprovider.tokens.CognitoRefreshToken;
4747
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoDeviceHelper;
48+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoJWTParser;
4849
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoSecretHash;
4950
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.CognitoServiceConstants;
5051
import com.amazonaws.mobileconnectors.cognitoidentityprovider.util.Hkdf;
@@ -83,6 +84,8 @@
8384
import com.amazonaws.services.cognitoidentityprovider.model.ResourceNotFoundException;
8485
import com.amazonaws.services.cognitoidentityprovider.model.RespondToAuthChallengeRequest;
8586
import com.amazonaws.services.cognitoidentityprovider.model.RespondToAuthChallengeResult;
87+
import com.amazonaws.services.cognitoidentityprovider.model.RevokeTokenRequest;
88+
import com.amazonaws.services.cognitoidentityprovider.model.RevokeTokenResult;
8689
import com.amazonaws.services.cognitoidentityprovider.model.SMSMfaSettingsType;
8790
import com.amazonaws.services.cognitoidentityprovider.model.SetUserMFAPreferenceRequest;
8891
import com.amazonaws.services.cognitoidentityprovider.model.SetUserMFAPreferenceResult;
@@ -2332,6 +2335,28 @@ private void deleteAttributesInternal(final List<String> attributeNamesToDelete,
23322335
cognitoIdentityProviderClient.deleteUserAttributes(deleteUserAttributesRequest);
23332336
}
23342337

2338+
public RevokeTokenResult revokeTokens() {
2339+
try {
2340+
CognitoUserSession cognitoUserSession = getCachedSession();
2341+
String accessToken = cognitoUserSession.getAccessToken().getJWTToken();
2342+
if (CognitoJWTParser.hasClaim(accessToken, "origin_jti")) {
2343+
String refreshToken = cognitoUserSession.getRefreshToken().getToken();
2344+
RevokeTokenRequest request = new RevokeTokenRequest();
2345+
request.setToken(refreshToken);
2346+
request.setClientId(clientId);
2347+
if (!StringUtils.isBlank(clientSecret)) {
2348+
request.setClientSecret(clientSecret);
2349+
}
2350+
return cognitoIdentityProviderClient.revokeToken(request);
2351+
} else {
2352+
LOGGER.debug("Access Token does not contain `origin_jti` claim. Skip revoking tokens.");
2353+
}
2354+
} catch (final Exception e) {
2355+
LOGGER.warn("Failed to revoke tokens.", e);
2356+
}
2357+
return null;
2358+
}
2359+
23352360
/**
23362361
* Sign-Out this user by removing all cached tokens.
23372362
*/

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ public static String getClaim(String jwt, String claim) {
115115
return null;
116116
}
117117

118+
/**
119+
* Checks if a JWT token contains a claim.
120+
* @param jwt A string, possibly not event a JWT
121+
* @param key Key for a claim, e.g., "jti" or "aud"
122+
* @return True if JWT is a valid JWT and contains the requested claim, false otherwise
123+
*/
124+
public static boolean hasClaim(String jwt, String key) {
125+
try {
126+
return getPayload(jwt).has(key);
127+
} catch (Exception e) {
128+
return false;
129+
}
130+
}
131+
118132
/**
119133
* Checks if {@code JWT} is a valid JSON Web Token.
120134
*

aws-android-sdk-mobile-client/src/androidTest/java/com/amazonaws/mobile/client/AWSMobileClientTest.java

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
import com.amazonaws.mobile.client.results.Tokens;
3232
import com.amazonaws.mobile.client.results.UserCodeDeliveryDetails;
3333
import com.amazonaws.mobile.config.AWSConfiguration;
34+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice;
35+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser;
36+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserDetails;
37+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool;
38+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession;
39+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation;
40+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.ChallengeContinuation;
41+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.MultiFactorAuthenticationContinuation;
42+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.AuthenticationHandler;
43+
import com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.GetDetailsHandler;
3444
import com.amazonaws.regions.Region;
3545
import com.amazonaws.regions.Regions;
3646
import com.amazonaws.services.cognitoidentity.AmazonCognitoIdentity;
@@ -50,6 +60,7 @@
5060
import com.amazonaws.services.cognitoidentityprovider.model.ListUsersRequest;
5161
import com.amazonaws.services.cognitoidentityprovider.model.ListUsersResult;
5262
import com.amazonaws.services.cognitoidentityprovider.model.MessageActionType;
63+
import com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException;
5364
import com.amazonaws.services.cognitoidentityprovider.model.ResourceNotFoundException;
5465
import com.amazonaws.services.cognitoidentityprovider.model.UserNotConfirmedException;
5566
import com.amazonaws.services.cognitoidentityprovider.model.UserType;
@@ -104,6 +115,7 @@ public class AWSMobileClientTest extends AWSMobileClientTestBase {
104115
private static final int THROTTLED_DELAY = 5000;
105116

106117
static AmazonCognitoIdentityProvider userpoolLL;
118+
static CognitoUserPool userPool;
107119

108120
static {
109121
try {
@@ -117,6 +129,8 @@ public class AWSMobileClientTest extends AWSMobileClientTestBase {
117129
static Regions clientRegion = Regions.US_WEST_2;
118130
static String userPoolId;
119131
static String identityPoolId;
132+
static String clientId;
133+
static String clientSecret;
120134

121135
Context appContext;
122136
AWSMobileClient auth;
@@ -226,13 +240,17 @@ public void onError(Exception e) {
226240
assertNotNull(userPoolConfig);
227241
clientRegion = Regions.fromName(userPoolConfig.getString("Region"));
228242
userPoolId = userPoolConfig.getString("PoolId");
243+
clientId = userPoolConfig.getString("AppClientId");
244+
clientSecret = userPoolConfig.optString("AppClientSecret");
229245

230246
JSONObject identityPoolConfig =
231247
awsConfiguration.optJsonObject("CredentialsProvider").getJSONObject(
232248
"CognitoIdentity").getJSONObject("Default");
233249
assertNotNull(identityPoolConfig);
234250
identityPoolId = identityPoolConfig.getString("PoolId");
235251

252+
userPool = new CognitoUserPool(appContext, userPoolId, clientId, clientSecret, clientRegion);
253+
236254
deleteAllUsers(userPoolId);
237255
createUserViaAdminAPI(userPoolId, USERNAME_ADMIN_API_USER, EMAIL_ADMIN_API_USER);
238256
}
@@ -413,6 +431,124 @@ public void onUserStateChanged(UserStateDetails details) {
413431
assertNotEquals(getPackageConfigure().getString("identity_id"), details.toString());
414432
}
415433

434+
@Test
435+
public void testRevokeTokenWithSignedInUser() throws Exception {
436+
auth.signIn(username, PASSWORD, null);
437+
assertTrue("isSignedIn is true", auth.isSignedIn());
438+
439+
final AtomicReference<Boolean> tokenRevoked = new AtomicReference<Boolean>(false);
440+
final CountDownLatch revokeTokenLatch = new CountDownLatch(2);
441+
final CognitoUser user = userPool.getCurrentUser();
442+
user.getSession(new AuthenticationHandler() {
443+
@Override
444+
public void onSuccess(CognitoUserSession userSession, CognitoDevice newDevice) {
445+
revokeTokenLatch.countDown();
446+
}
447+
448+
@Override
449+
public void getAuthenticationDetails(AuthenticationContinuation authenticationContinuation, String userId) {
450+
451+
}
452+
453+
@Override
454+
public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
455+
456+
}
457+
458+
@Override
459+
public void authenticationChallenge(ChallengeContinuation continuation) {
460+
461+
}
462+
463+
@Override
464+
public void onFailure(Exception exception) {
465+
exception.printStackTrace();
466+
fail("Sign in failed.");
467+
}
468+
});
469+
470+
user.getDetails(new GetDetailsHandler() {
471+
@Override
472+
public void onSuccess(CognitoUserDetails cognitoUserDetails) {
473+
revokeTokenLatch.countDown();
474+
}
475+
476+
@Override
477+
public void onFailure(Exception exception) {
478+
exception.printStackTrace();
479+
fail("Get user details failed.");
480+
}
481+
});
482+
483+
try {
484+
user.revokeTokens();
485+
tokenRevoked.set(true);
486+
} catch (Exception e) {
487+
e.printStackTrace();
488+
}
489+
490+
revokeTokenLatch.await(5, TimeUnit.SECONDS);
491+
assertTrue(tokenRevoked.get());
492+
493+
user.getDetails(new GetDetailsHandler() {
494+
@Override
495+
public void onSuccess(CognitoUserDetails cognitoUserDetails) {
496+
fail("Request to get user details should fail with NotAuthorizedException after token is revoked.");
497+
}
498+
499+
@Override
500+
public void onFailure(Exception exception) {
501+
assertTrue(exception instanceof NotAuthorizedException);
502+
}
503+
});
504+
}
505+
506+
@Test
507+
public void testRevokeTokenWithSignedOutUser() throws Exception {
508+
auth.signIn(username, PASSWORD, null);
509+
assertTrue("isSignedIn is true", auth.isSignedIn());
510+
511+
final CountDownLatch revokeTokenLatch = new CountDownLatch(1);
512+
final CognitoUser user = userPool.getCurrentUser();
513+
user.getSession(new AuthenticationHandler() {
514+
@Override
515+
public void onSuccess(CognitoUserSession userSession, CognitoDevice newDevice) {
516+
revokeTokenLatch.countDown();
517+
}
518+
519+
@Override
520+
public void getAuthenticationDetails(AuthenticationContinuation authenticationContinuation, String userId) {
521+
522+
}
523+
524+
@Override
525+
public void getMFACode(MultiFactorAuthenticationContinuation continuation) {
526+
527+
}
528+
529+
@Override
530+
public void authenticationChallenge(ChallengeContinuation continuation) {
531+
532+
}
533+
534+
@Override
535+
public void onFailure(Exception exception) {
536+
exception.printStackTrace();
537+
fail("Sign in failed.");
538+
}
539+
});
540+
revokeTokenLatch.await(5, TimeUnit.SECONDS);
541+
542+
auth.signOut();
543+
assertFalse("isSignedIn is false", auth.isSignedIn());
544+
545+
try {
546+
user.revokeTokens();
547+
} catch (Exception e) {
548+
assertTrue(e instanceof InvalidParameterException);
549+
}
550+
}
551+
416552
@Test
417553
public void testIdentityId() throws Exception {
418554
try {
@@ -524,6 +660,28 @@ public void testSignOut() throws Exception {
524660
}
525661
}
526662

663+
@Test
664+
public void testSignedOutWithRevokeToken() throws Exception {
665+
auth.signIn(username, PASSWORD, null);
666+
assertTrue("isSignedIn is true", auth.isSignedIn());
667+
668+
String tokenWithOriginJTI = "eyJraWQiOiIwTmxhQUhzbmtwQW5zbHBzUFhHWkJKcVJoR3E5WTkwckwweXpaWUV1OTJZPSIsImFsZyI6IlJTMjU2In0.eyJvcmlnaW5fanRpIjoiMzM2MWFkZDMtMDIwNS00NTY1LTk0MjQtMDQ3YWQ2N2Y0MjhmZWwifQ.a";
669+
setAccessToken(appContext, clientId, username, tokenWithOriginJTI);
670+
auth.signOut();
671+
assertFalse("isSignedIn is false", auth.isSignedIn());
672+
}
673+
674+
@Test
675+
public void testSignedOutWithoutRevokeToken() throws Exception {
676+
auth.signIn(username, PASSWORD, null);
677+
assertTrue("isSignedIn is true", auth.isSignedIn());
678+
679+
String tokenWithSub = "eyJraWQiOiJzU01EYmZyQ21pb3FrbEVRZFprNXl6UmszekxSTlo4aGlGMnlxdVFZbVM0PSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI3YTQyNTFmMS04MmEyLTQxNzgtOWZhOS1mNmE3MTc1RCJ9.a";
680+
setAccessToken(appContext, clientId, username, tokenWithSub);
681+
auth.signOut();
682+
assertFalse("isSignedIn is false", auth.isSignedIn());
683+
}
684+
527685
@Test(expected = com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException.class)
528686
public void testSignInWrongPassword() throws Exception {
529687
AWSMobileClient.getInstance().signIn(getPackageConfigure().getString("username"), "wrong", null);

aws-android-sdk-mobile-client/src/androidTest/java/com/amazonaws/mobile/client/AWSMobileClientTestBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ public static void writeUserPoolsTokens(final Context appContext, final String c
7171
awsKeyValueStore.put(storeFieldPrefix + "refreshToken", "DummyRefresh");
7272
}
7373

74+
public static void setAccessToken(final Context appContext, final String clientId, final String username, final String accessToken) {
75+
final AWSKeyValueStore awsKeyValueStore = new AWSKeyValueStore(appContext,
76+
"CognitoIdentityProviderCache",
77+
true);
78+
String storeFieldPrefix = "CognitoIdentityProvider." + clientId + "." + username + ".";
79+
awsKeyValueStore.put(storeFieldPrefix + "accessToken", accessToken);
80+
}
81+
7482
public static void writeUserPoolsTokens(final Context appContext,
7583
final String clientId,
7684
final String userId,

aws-android-sdk-mobile-client/src/androidTest/java/com/amazonaws/mobile/client/AbstractAmazonCognitoIdentity.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import com.amazonaws.services.cognitoidentity.model.GetOpenIdTokenForDeveloperIdentityResult;
4343
import com.amazonaws.services.cognitoidentity.model.GetOpenIdTokenRequest;
4444
import com.amazonaws.services.cognitoidentity.model.GetOpenIdTokenResult;
45+
import com.amazonaws.services.cognitoidentity.model.GetPrincipalTagAttributeMapRequest;
46+
import com.amazonaws.services.cognitoidentity.model.GetPrincipalTagAttributeMapResult;
4547
import com.amazonaws.services.cognitoidentity.model.ListIdentitiesRequest;
4648
import com.amazonaws.services.cognitoidentity.model.ListIdentitiesResult;
4749
import com.amazonaws.services.cognitoidentity.model.ListIdentityPoolsRequest;
@@ -53,6 +55,8 @@
5355
import com.amazonaws.services.cognitoidentity.model.MergeDeveloperIdentitiesRequest;
5456
import com.amazonaws.services.cognitoidentity.model.MergeDeveloperIdentitiesResult;
5557
import com.amazonaws.services.cognitoidentity.model.SetIdentityPoolRolesRequest;
58+
import com.amazonaws.services.cognitoidentity.model.SetPrincipalTagAttributeMapRequest;
59+
import com.amazonaws.services.cognitoidentity.model.SetPrincipalTagAttributeMapResult;
5660
import com.amazonaws.services.cognitoidentity.model.TagResourceRequest;
5761
import com.amazonaws.services.cognitoidentity.model.TagResourceResult;
5862
import com.amazonaws.services.cognitoidentity.model.UnlinkDeveloperIdentityRequest;
@@ -123,6 +127,11 @@ public GetOpenIdTokenForDeveloperIdentityResult getOpenIdTokenForDeveloperIdenti
123127
return null;
124128
}
125129

130+
@Override
131+
public GetPrincipalTagAttributeMapResult getPrincipalTagAttributeMap(GetPrincipalTagAttributeMapRequest getPrincipalTagAttributeMapRequest) throws AmazonClientException, AmazonServiceException {
132+
return null;
133+
}
134+
126135
@Override
127136
public ListIdentitiesResult listIdentities(ListIdentitiesRequest listIdentitiesRequest) throws AmazonClientException, AmazonServiceException {
128137
return null;
@@ -153,6 +162,11 @@ public void setIdentityPoolRoles(SetIdentityPoolRolesRequest setIdentityPoolRole
153162

154163
}
155164

165+
@Override
166+
public SetPrincipalTagAttributeMapResult setPrincipalTagAttributeMap(SetPrincipalTagAttributeMapRequest setPrincipalTagAttributeMapRequest) throws AmazonClientException, AmazonServiceException {
167+
return null;
168+
}
169+
156170
@Override
157171
public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) throws AmazonClientException, AmazonServiceException {
158172
return null;

aws-android-sdk-mobile-client/src/androidTest/java/com/amazonaws/mobile/client/AbstractAmazonCognitoIdentityProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ public RespondToAuthChallengeResult respondToAuthChallenge(RespondToAuthChalleng
434434
return null;
435435
}
436436

437+
@Override
438+
public RevokeTokenResult revokeToken(RevokeTokenRequest revokeTokenRequest) throws AmazonClientException, AmazonServiceException {
439+
return null;
440+
}
441+
437442
@Override
438443
public SetRiskConfigurationResult setRiskConfiguration(SetRiskConfigurationRequest setRiskConfigurationRequest) throws AmazonClientException, AmazonServiceException {
439444
return null;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,9 @@ public Void run() throws Exception {
16111611
userpoolLL.globalSignOut(globalSignOutRequest);
16121612
}
16131613
if (signOutOptions.isInvalidateTokens()) {
1614+
if (userpool != null) {
1615+
userpool.getCurrentUser().revokeTokens();
1616+
}
16141617
if (hostedUI != null) {
16151618
if (signOutOptions.getBrowserPackage() != null) {
16161619
hostedUI.setBrowserPackage(signOutOptions.getBrowserPackage());

0 commit comments

Comments
 (0)