-
Notifications
You must be signed in to change notification settings - Fork 824
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
Amplify CLI Authentication is not consistent, documentation does not clearly describe setup. Erratic! #12936
Comments
My recent token expired, and I found that I now must use the credentials file to make my amplify push work. So this is all very confusing, when a few days ago I did not need this. I previously changed version "^4.6.0" of "@aws-amplify/ui-react" back to "^5.0.4" maybe that caused some of the IAM(SSO) difference? |
Hey @qwikag, thank you for reaching out. The support for AWS SSO in Amplify CLI is currently being tracked as a feature request on #4488. |
Hey @ykethan so the problem is BAD DOCUMENTATION! |
To re-iterate this was my fix: However also deleting the profile from this file meant it did not go looking for the credentials file, so I removed 2 files from the situation... (maybe it is required on a 30day, once expired, basis???) Reflecting on the "Documentation" (POOR AT BEST) but it also refers to the use of the Credentials file which I have now stopped using, how long will it be until that stops working??? I do not know what process is required but these files are what I was able to adjust and fix my issues (file and example text). [sso-session my-sso] 2. Using the "Command line or programmatic access" pop up again copy and paste the environment variables 3. there are 2 other environment variables (5 in total) I have set as persistent: If you must you can also add to the .aws/credentials file details from the "Command line or programmatic access" pop up. I recognise persisting the env variables may mean it does enable multiple profiles. Any way the upshot of all of this is that Auth Documentation is a complete disaster and needs to be fixed, otherwise people will go elsewhere. |
PLEASE LEAVE THIS OPEN UNTIL DOUMENTATION IS FIXED! |
Hey @qwikag 👋 ideally this auth flow is 1:1 with what is supported with the AWS CLI and reflected in the AWS documentation. Currently we have a bug that prevents the usage of AWS SSO as defined in the documentation and similar to the config you've provided. I've swapped a few labels here to improve the documentation once the SSO support is fixed, however in the meantime does the workaround noted here resolve the issue? #4488 (comment) |
No it does not. But also how it is meant to be used, has not been explained. Also it refers to "amplify init" which is a one off command/ process used at the start of a project. |
By the way, why had this turned into a feature request? This feature of being able to login is already in production. This is a bug related to documention. Please do not hide it in feature request processes. |
It is not just platform init Yes that's where I encountered it first. |
@josefaidt, @Jay2113, Someone, I have recently updated to the latest Amplify version and Next.js version. I am using IAM (SSO) and on Windows with VSCode running all up to date versions in npm Here is my abbreviated config:
Environment Variables commands look like this:
And my amplify command that gives me the error is:
|
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
20.3.1
Amplify CLI Version
12.1.1
What operating system are you using?
Windows 10
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
Sorry Unsure.
I would have setup Data Model in the Console???
Describe the bug
Summary:
I am fully installed in VSCode and have been using Amplify for a couple of weeks now. (pushing and pulling on amplify and git)
I just did an 'amplify update auth'
I now wish to run 'amplify push' command from terminal.
I get this error (again like I did weeks ago):
Please now head to the bottom for my terminal output...
Background:
For transparency, I am very new to AWS.
Amplify is designed for people like me "technical, but not familiar with detailed AWS services"
So the expectation is that the guides /tutorials just work.
Problem 1 - setting up IAM(SSO) Auth in Amplify-cli is an absolute nightmare, the docs need and overhaul. you may think the guide works but actually it is very confusing. I would be happy to sit down and demonstrate this to the owner of said docs.
Problem 2 - is the issue I am raising right now whereby Auth has been working fine since I got it working a couple of weeks ago.
now it spits out and error right at the end of an amplify push just as it is about to finish
Problem 3 - this experience has been the most frustrating experience of my 30 year IT career. sorry to be blunt but I have never had to deal with such documentation which takes the individual to the 90% mark and drops them off the cliff.
Here is my Terminal Output:
(simplified for readability):
Expected behavior
It authenticates and finishes successfully!
like other processes I have run.
it is not disparate nor can it be random and sometimes work other times not.
nor is there a need for some many auth setups.
it should be simple and not so hard.
more documented explanation of how it works with a flow diagram of what files are utilised during this process.
Reproduction steps
Add Google Recaptcha to Auth.
amplify Push
publish it fails due to Google Recaptcha
remove Google Recaptcha
amplify Push
Auth error.
really not sure what is causing it so no idea what the steps are.
Project Identifier
No response
Log output
OK I think I found the issue here in the logs, so I continue to log it so someone can address to craziness because this is not in the docs and it also seems to be buggy and disparate technically
Here is the line in my log output that helped: in bold is the culprit:
2023-07-12T08:03:00.325Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["AmplifyAdminAccess-012343456789"])
further info below...
Additional information
the Auth Screen on the AWS front door
give me this:
[012343456789_AmplifyAdminAccess]
aws_access_key_id=qwertyasdfgh
aws_secret_access_key=blahdeeblahdebladeeblah
aws_session_token=dytbb5uube//////////wEblahdeeblahdebladeeblahDczMzI1IgblahdeeblahdebladeeblahAIIR...
AmplifyAdminAccess-012343456789 in the logs is completely formatted incorrect and not what is in my config file, nor what is given to me from the AWS START page.
This problem stems from the bad documentation that sent me down many rabbit holes, and may have cause me to write a file wrong at some point, but in any case why have I been able to login and now not :( and why are these 2 formats existing the format of profile names should be a locked in syntax.
and made no mention of a profile name in another config file...
local-aws-ingo.json:
{
"dev": {
"configLevel": "project",
"useProfile": true,
"profileName": "some_other_random_profile_name"
},
"main": {
"configLevel": "project",
"useProfile": true,
"profileName": "AmplifyAdminAccess-012343456789"
}
}
it cannot find:
AmplifyAdminAccess-012343456789
because my config is the opposite way around and has an underscore????
OK updating the local-aws-ingo.json: with the profile name from the auth screen worked.
But something needs to be done to make this easy.
Thank you log files!
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: