I'm not understand with Amazon Cognito documentation. I followed the instruction to set up Google Sign In and successfully retrieved the IDToken, add my Amazon Cognito User Pool domain URL in the Google app's Authorized redirect URIs. However I don't know how to redirect Idp token to Cognito user pool and add into it.
Besides, I dont know how to setup callback URL and sign out URL for my android app at App Client Setting section. Not sure if necessary or not to setup...
So my google sign in is exactly like google documentation.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AppHelper.init(getApplicationContext());
inUsername = findViewById(R.id.editTextUserId);
inPassword = findViewById(R.id.editTextUserPassword);
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.server_client_id))
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
SignInButton signInButton = findViewById(R.id.sign_in_button);
signInButton.setSize(SignInButton.SIZE_WIDE);
signInButton.setOnClickListener(this);
}
Then I get ID token
private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class);
// Signed in successfully, show authenticated UI.
updateUI(account);
idToken = account.getIdToken();
finish();
} catch (ApiException e) {
// The ApiException status code indicates the detailed failure reason.
// Please refer to the GoogleSignInStatusCodes class reference for more information.
Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
updateUI(null);
}
}
So I signed in. My problem is what should I do next to add my google ID to Cognito User Pool? Is it possible no need go through Oauth process since I already authorized and gave basic permission (GoogleSignInOptions.DEFAULT_SIGN_IN) when signing in?