Wednesday, February 28, 2018

AWS Cognito - Get user data after login with SignInUI

Leave a Comment

I followed the instructions at Add AWS Mobile User Sign In

The code looks like this:

public class LoginActivity extends AppCompatActivity {      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_login);          AWSMobileClient.getInstance().initialize(this, new AWSStartupHandler() {             @Override             public void onComplete(AWSStartupResult awsStartupResult) {                 SignInUI signIn = (SignInUI) AWSMobileClient.getInstance().getClient(LoginActivity.this, SignInUI.class);                 signIn.login(LoginActivity.this, MainActivity.class).execute();              }         }).execute();     } } 

My question is, how do I get the public claims for the logged in user (ie email, name etc.) so I can know who logged in? The only ways I've seen is to do it is manually which seems to require a client secret which I obviously don't have as this is a client side mobile app.

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment