furaiev / amazon-cognito-identity-dart-2

Unofficial Amazon Cognito Identity Provider Dart SDK, to easily add user sign-up and sign-in to your mobile and web apps with AWS.
MIT License
187 stars 114 forks source link

Guest auth support #28

Closed stopdropandrew closed 4 years ago

stopdropandrew commented 4 years ago

This pull allows unauthenticated access to identity pools identities and AWS credentials. I changed the constructor for CognitoIdentityId since it wasn't in the docs.

I would like to change CognitoCredentials constructor in a similar way, passing in token and authenticator, so that the CognitoIdentityId could be cached, but it would require changing the public API and docs, so I left it for now.

Alternatively, the change could mirror amplify-cognito-identity-js even more, passing in Logins like

new AWS.CognitoIdentityCredentials({
  IdentityPoolId: '...', // your identity pool id here
  Logins: {
    // Change the key below according to the specific region your user pool is in.
    'cognito-idp.<region>.amazonaws.com/<YOUR_USER_POOL_ID>': result
      .getIdToken()
      .getJwtToken(),
  },
});
furaiev commented 4 years ago

@stopdropandrew thank you for your collaboration, pls check latest package version 0.1.11.

stopdropandrew commented 4 years ago

Thanks for merging!

On Sat, Mar 21, 2020 at 11:05 AM Alex Furaiev notifications@github.com wrote:

@stopdropandrew https://github.com/stopdropandrew thank you for your collaboration, pls check latest package version 0.1.11.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/furaiev/amazon-cognito-identity-dart-2/pull/28#issuecomment-602080762, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABUGJDDN7F6ZPARVVXM53RIT6VLANCNFSM4LBV3PYQ .

imshashank commented 4 years ago

Is there a way to Switch Unauthenticated Users to Authenticated Users as explained here: https://docs.aws.amazon.com/cognito/latest/developerguide/switching-identities.html

I am not able to find a method for this.