New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The security token included in the request is invalid #114
Comments
Hi @keithbeller, this is most likely due to invalid AWS credentials. Can you please check your credentials setup and provide us with more information about how you're using credentials if you are still experience an issue. |
@klaytaybai I'm experiencing this as well. I just issued myself brand new IAM User credentials that have Administrator Access attached as a policy. When I use this SDK, I receive the same exception. Edit: To clarify, I ran |
@scionwest are you using the VS Toolkit? |
@klaytaybai at one point in VS 2017 I was. I’ve since uninstalled the toolkit and VS 17; using VS 19 vanilla now. |
Is there any update to this or other ways I can receive help? Our Enterprise support said we need to post this to GitHub to receive support. I’ve not been able to get this answered though. It’s starting to get frustrating that the only way to get support on an Amazon SDK item is on GitHub. Why can’t these items be covered by our (expensive) Enterprise support agreement? |
Hi @scionwest, Can you please make sure you have a credential file with a default profile: https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html#creds-file It may be that due to the VS19 without toolkit installed you don't have any creds being picked up. This really look like a credentials / wrong user pool secret issue because of the computed hashes. |
It may also be helpful for us if you can provide an example of how you are naming your profile in the credentials file. |
I've fully uninstalled Visual Studio, all of the extensions, cleaned up any environment variables I had that were related to the AWS SDK, blown away the credentials/config files and re-generated them with |
I have the same issue however I have configured an app client instead and calling it like this from android app:
I have set up a App Client in my user pool as the following docs describe: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-client-apps.html |
I figured out my issue. I didn't set the variables: AWS_SECRET_KEY and AWS_ACCESS_KEY_ID. When I did the issue resolved. Thank you for your help. I followed the directions on Snevsky.com to find my answer.
Here was the change I made to the Startup.cs file. If you inject the AmazonCognitoIdentityProviderClient and CognitoUserPool services the sample works.
|
For anyone else encountering "The security token included in the request is invalid" exception, the solution is to create your AmazonCognitoIdentityProviderClient using the Amazon.RegionEndpoint parameter instead of passing in the region as a string. For example:
|
@jerhewet |
Looks like instanciating |
I've manually added a user the General Settings > Users and groups.
I launch the application locally, navigate to the login page, enter creds from the account and get the following error message when submitting the login request:
App Configuration
Using the latest Sample application unmodified.
appsettings.Development.json set as follows:
"AWS": {
"Region": "us-east-1", // value taken from General settings
"UserPoolClientId": "6u.....", // value taken from General settings > App clients > App client id
"UserPoolClientSecret": "i6....", // value taken from General settings > App clients > App client secret
"UserPoolId": "us-east-1_....." // value taken from General settings > Pool Id
}
User Pool Configuration:
Attributes
Policies
MFA and verifications
App clients
App integration > App client settings
The text was updated successfully, but these errors were encountered: