简体   繁体   English

flutter_graphql 与 AWS

[英]flutter_graphql with AWS

can anyone help me to configuring flutter_graphql package for aws-graphql with aws-cognito as Auth instead of api-key.谁能帮我为 aws-graphql 配置 flutter_graphql package,使用 aws-cognito 作为 Auth 而不是 api-key。

final AuthLink authLink = AuthLink( getToken: () async => 'Bearer <YOUR_PERSONAL_ACCESS_TOKEN>', );

I can't understand how do I configure it with aws-cognito.我不明白如何使用 aws-cognito 配置它。 I know I have to use aws_cognito_identity_pool_id.我知道我必须使用 aws_cognito_identity_pool_id。 but I can't figure out how.但我不知道怎么做。

use amazon_cognito_identity_dart_2 flutter package to create session and then get JWTtoken.使用 amazon_cognito_identity_dart_2 flutter package 创建 session 然后获取 JWTtoken。

`final token = session.getAccessToken().getJwtToken(); `最终令牌 = session.getAccessToken().getJwtToken(); //session from amazon_cognito_identity_dart_2 //来自 amazon_cognito_identity_dart_2 的会话

final AuthLink authLink = AuthLink( getToken: () => token, );` final AuthLink authLink = AuthLink( getToken: () => token, );`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM