我正在尝试使用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)}))
但它会返回The security token included in the request is invalid
。
答案 0 :(得分:0)
我正在使用该池的客户端ID /机密,而不是我的AWS。