Flutter AWS Cognito用户池

Flutter AWS Cognito用户池,flutter,amazon-cognito,aws-amplify,aws-userpools,Flutter,Amazon Cognito,Aws Amplify,Aws Userpools,我使用AWS Amplify for Flatter插件使用Cognito进行用户身份验证。当我执行amplify add auth然后执行amplify push时,会创建一个包含多个资源的CloudFormation堆栈,包括一个用户池和身份池。还创建了两个应用程序客户端。其中一个在我的颤振应用程序的lib/configuration.dart中引用 使用CognitoAPI,我能够向用户池注册新用户。我可以使用以下代码获取密钥、ID令牌 CognitoAuthSession session

我使用AWS Amplify for Flatter插件使用Cognito进行用户身份验证。当我执行
amplify add auth
然后执行
amplify push
时,会创建一个包含多个资源的CloudFormation堆栈,包括一个用户池和身份池。还创建了两个应用程序客户端。其中一个在我的颤振应用程序的
lib/configuration.dart
中引用

使用CognitoAPI,我能够向用户池注册新用户。我可以使用以下代码获取密钥、ID令牌

CognitoAuthSession session = await Amplify.Auth.fetchAuthSession(options: CognitoSessionOptions(getAWSCredentials: true));

print('Access key: ${session.credentials.awsAccessKey}');
print('Secret Key: ${session.credentials.awsSecretKey}');
print('Identity ID:  ${session.identityId}');
print('User Pool tokens: ${session.userPoolTokens.accessToken}');
print('User Pool tokens: ${session.userPoolTokens.idToken}');

我不明白的是,应用程序中引用的应用程序客户端没有启用用户池作为身份提供者(见图)。也没有选择OAuth流

  • 我的假设是,由于app客户端没有启用
    Cognito用户池
    ,因此当我尝试添加新用户时,可能会失败。但事实并非如此
  • 由于未选择OAuth流,因此不应返回ID令牌。但我可以拿到身份证令牌,访问令牌
  • Amplify cli还创建了一个标识池、两个角色(用于未经身份验证的用户和经过身份验证的用户)。它正在引用用户池

    我错过了什么?即使未启用用户池,它如何存储用户

    谢谢你抽出时间