1回答
- 新しい順
- 投票が多い順
- コメントが多い順
0
Hi, i found my answer. You can get the accessToken from this function below and here is the link for stackoverflow answer. https://stackoverflow.com/questions/66258459/how-to-get-aws-cognito-access-token-with-username-and-password-in-net-core-3-1
public static async Task<string> GetCredsAsync()
{
AmazonCognitoIdentityProviderClient provider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), Amazon.RegionEndpoint.USEast1);
CognitoUserPool userPool = new("", "", provider, "");
CognitoUser user = new("", "", userPool, provider, "");
InitiateSrpAuthRequest authRequest = new()
{
Password = ""
};
AuthFlowResponse authResponse = await user.StartWithSrpAuthAsync(authRequest).ConfigureAwait(false);
var accessToken = authResponse.AuthenticationResult.AccessToken;
return accessToken;
}
回答済み 1年前
関連するコンテンツ
- 質問済み 9ヶ月前
- AWS公式更新しました 2年前
- AWS公式更新しました 2年前
- AWS公式更新しました 1年前
- AWS公式更新しました 1年前