-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile-client): hosted-ui auth response handler is now built int…
…o 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
- Loading branch information
Showing
3 changed files
with
135 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...client/src/main/java/com/amazonaws/mobile/client/activities/HostedUIRedirectActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.amazonaws.mobile.client.activities; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
import com.amazonaws.mobile.client.AWSMobileClient; | ||
import com.amazonaws.mobileconnectors.cognitoauth.activities.CustomTabsManagerActivity; | ||
|
||
/** | ||
* Handles auth redirect for sign-in and sign-out. | ||
*/ | ||
public final class HostedUIRedirectActivity extends Activity { | ||
@Override | ||
public void onCreate(Bundle savedInstanceBundle) { | ||
super.onCreate(savedInstanceBundle); | ||
startActivity(CustomTabsManagerActivity.createResponseHandlingIntent( | ||
this, getIntent().getData())); | ||
} | ||
|
||
@Override | ||
public void onResume() { | ||
super.onResume(); | ||
Log.d("AuthClient", "Handling auth redirect response"); | ||
AWSMobileClient.getInstance().handleAuthResponse(getIntent()); | ||
finish(); | ||
} | ||
} |