如何获得 aws-sdk-go/service/cognitoidentity 的代币
How to get a token for aws-sdk-go/service/cognitoidentity
我正在尝试使用 go sdk 访问 coginto,但我不确定如何获取令牌,我正在创建我的 cogintoidentity:
creds := credentials.NewStaticCredentials("-id-", "-secret-", "")
sess := session.Must(session.NewSession())
sess.Config.Credentials = creds
sess.Config.Region = aws.String("us-east-1")
sess.Config.CredentialsChainVerboseErrors = aws.Bool(true)
svc := CP.New(sess) // CP == "github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
log.Println(svc.ListUserPools(&CP.ListUserPoolsInput{MaxResults: aws.Int64(10)}))
但是 returns The security token included in the request is invalid
.
我使用的是池的客户端 id/secret,而不是我的 AWS。
我正在尝试使用 go sdk 访问 coginto,但我不确定如何获取令牌,我正在创建我的 cogintoidentity:
creds := credentials.NewStaticCredentials("-id-", "-secret-", "")
sess := session.Must(session.NewSession())
sess.Config.Credentials = creds
sess.Config.Region = aws.String("us-east-1")
sess.Config.CredentialsChainVerboseErrors = aws.Bool(true)
svc := CP.New(sess) // CP == "github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
log.Println(svc.ListUserPools(&CP.ListUserPoolsInput{MaxResults: aws.Int64(10)}))
但是 returns The security token included in the request is invalid
.
我使用的是池的客户端 id/secret,而不是我的 AWS。