AWS Amplify cannot enter user keys - aws-amplify

I am going through the tutorial for AWS Amplify and I get to the point where I am to enter the keys for the newly created user
I get prompted for the access key:
Enter the access key of the newly created user:
? accessKeyId: [hidden]
I paste in the value for this and the secret key. But then it seems to fail with
You did NOT enter valid keys.
New user setup failed.
Error: New user setup failed.
at C:\Users\RKevi\AppData\Roaming\npm\node_modules\#aws-amplify\cli\node_modules\amplify-provider-awscloudformation\lib\setup-new-user.js:108:13
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Am I to type in the keys manually?
Thank you.

Related

Unable to create private key for Firebase Admin SDK - Failed to generate a private key. Please try again in a few minutes

When I try to generate a new private key to use the Firebase Admin SDK I get the error:
Failed to generate a private key. Please try again in a few minutes.
The error persists now for a while already. I never created a private key for this project so far.
My service account has the following roles (translated to english):
Cloud Functions Admin
Service account token creator
Firebase Admin SDK administrator service agent
Firebase Authentication Administrator
Anyone any idea?
Thanks!
Meanwhile I found out why I got this error or at least how to fix it:
I added Storage Admin as a role to my service account and I was able to generate a new key.

How can I get user info (all details) from AWS Amplify (Auth) with only username(email)?

I am using AWS Amplify (Auth) and I want to get user details with only username(email).
Is there any way to get user details before signing in?
I am following these docs: https://docs.amplify.aws/lib/auth/getting-started/q/platform/js/
You can get the user info by going to the Amplify AdminUI -> User Management and typing the username (email) of the user.
Now you have the unique id. of the user. Depending on how you setup your DynamoDB, you can use either that id you found or the email to search for the user. For example you could create a lambda function that at user signup creates an entry on DynamoDB and the id is the same as the one you find on User Management on Amplify AdminUI or it could be the email... up to you.
Specify User Details. Are you talking about the current logged in user or ANY user in your congito user pool?
Current User: just use Auth to get all the information available for the current user. https://aws-amplify.github.io/amplify-js/api/classes/authclass.html
Any cognito user: I think still need to build something yourself for that matter. You could create a lambda function and use the admin queries in that function to filter out "public" information about users or what so ever. https://docs.amplify.aws/cli/auth/admin/#admin-queries-api
You can also build lambda triggers for cognito if that already helps you. https://docs.amplify.aws/cli/usage/lambda-triggers/

Permission denied on key when encrypting secrets.yml file with helm and gcp_kms

I have a keyring and key in Google Cloud KMS. I want to use the key to encrypt a secrets.yml file using helm secrets enc
I am the GCP project owner, and I have also given myself the specific encrypt/decrypt IAM role, which I don't think is needed, given I am the owner, but worth a try a thought.
I'm getting the following permission denied error when trying to run helm secrets enc secrets.yml:
Could not generate data key: [failed to encrypt new data key with
master key
"projects/myproject-266813/locations/global/keyRings/myKeyRing/cryptoKeys/myKey":
Failed to call GCP KMS encryption service: googleapi: Error 403:
Permission 'cloudkms.cryptoKeyVersions.useToEncrypt' denied on
resource
'projects/myproject-266813/locations/global/keyRings/myKeyRing/cryptoKeys/myKey'
(or it may not exist)., forbidden]
My .sops.yml file:
creation_rules:
- gcp_kms: projects/mirkwood-266813/locations/global/keyRings/lotr/cryptoKeys/cdlkey
I am authenticated with the correct gcp account, so what am I missing?
The answer to this turned out to be really simple:
gcloud auth application-default login
or
use a service account
gcloud auth login
on it's own did not work

Authenticate the firebase private database using rest api

Generated the token Using this file for authentication.
After that, I generated a rest url by reading this document
I hit from my terminal curl "https://sampleproject-763e9.firebaseio.com/USERS.json/?auth=my generated token from above file".
For the generation of my token, I used these two things:
Enter User ID:userM1
My Jason which I got from firebase by going into project settings->serviceaccounts->adminsdk and clicking generate new private key.
I got this error
{ "error" : "Invalid claim 'kid' in auth header: '5e3994c7ce7839ecbe22b9c01e0cc0e1db2593b1' with iat: '1505402027'" }.
This is how my database looks like
These are the rules for my private database.My output.
This not the way to get authentication to firebase secret database.
After generating the token from json you have to generate access token by signing in.

Error while registering user via Cognito on local DynamoDB

I faced with such error
Request must contain either a valid (registered) AWS access key ID or X.509 certificate.
While trying to register an user via Cognito in DynamoDB Local. An user registers ok when I disconnect from DynamoDB and I can create an record in db programmatically.
The error comes from the DynamoDB. Please have a look:
http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/CommonErrors.html

Resources