Guest access
Many applications have UX with "Guest" or "Unauthenticated" users. This is provided out of the box with AWSMobileClient
through the initialization routine you have added. However, the Amplify CLI does not enable this by default with the amplify add auth
flow. You can enable this by running amplify update auth
and choosing Manual Configuration
when prompted. Ensure you choose the ...connected with AWS IAM controls which will allow you to select Allow unauthenticated logins.
When complete run amplify push
and your awsconfiguration.json
will work automatically with your updated Cognito settings. The AWSMobileClient
user session will automatically have permissions configured for Guest/Unauthenticated users upon initialization.
If you login in your app either using the "Drop-In Auth" or the AWSMobileClient
APIs then the user session will transition to an authenticated role.
Note: If initialize is giving you the state as SIGNED_OUT
, try calling AWSMobileClient.getInstance().getCredentials()
and then calling initialize again.