-
Notifications
You must be signed in to change notification settings - Fork 816
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
feat: allow login via admin ui on safari #10407
Conversation
175b6eb
to
54fb442
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
"jsdoc", | ||
"jwks", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: for this is probably better to add a lint ignore that adding to the dictionary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally our spell checker would allow names of dependencies or exports of dependencies
if (!req.body || req.body.error) { | ||
this.shutdown(); | ||
if (req.body.error === 'CANCELLED') { | ||
this.print.info('Login cancelled'); | ||
this.print.info('Login canceled'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require careful alignment with the Studio team. If they don't roll out at the same time, either the code will presented in the web ui (with nowhere to paste it) or the CLI will prompt for a code that does not appear anywhere in the web ui. |
13c6986
to
1469b0c
Compare
This pull request introduces 1 alert when merging 1469b0c into 59c6422 - view on LGTM.com new alerts:
|
1469b0c
to
3820a94
Compare
This pull request introduces 1 alert when merging 3820a94 into 59c6422 - view on LGTM.com new alerts:
|
3820a94
to
af36419
Compare
This pull request introduces 1 alert when merging af36419 into 59c6422 - view on LGTM.com new alerts:
|
af36419
to
e0eeff9
Compare
This pull request introduces 1 alert when merging e0eeff9 into d9bdcd8 - view on LGTM.com new alerts:
|
e0eeff9
to
83b0589
Compare
This pull request introduces 1 alert when merging 83b0589 into 59089dd - view on LGTM.com new alerts:
|
83b0589
to
ac06145
Compare
I will merge this when the backend is ready |
This pull request introduces 1 alert when merging ac06145 into 21ceba1 - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #10407 +/- ##
==========================================
- Coverage 46.57% 46.56% -0.02%
==========================================
Files 703 703
Lines 35246 35256 +10
Branches 7134 7134
==========================================
+ Hits 16417 16418 +1
- Misses 17042 17051 +9
Partials 1787 1787
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
fixes #6965 |
…#10407)" (aws-amplify#10602)" This reverts commit 16104ea.
Description of changes
Currently, when pulling a project via
amplify pull
, it is possible to use Amplify Studio to fetch authentication tokens in browser and pass them off to the CLI's admin-login express server.However, the local express server cannot be reached in certain browsers due to security settings (including Safari, Brave, and others).
Currently, this is "solved" with a warning banner, alerting the user to switch to Chrome, Firefox, or Edge (browsers that do not [yet] enforce this policy).
This PR proposes a new solution this problem. First, the browser will hit a
GET /ping
endpoint to check whether communication with the local express server is possible from the given context, which can be used instead of a known list of working browsers. This also makes SSH authentication workflows possible.If communication is possible, it will continue to work by passing tokens to the express server.
If communication is not possible, the browser will instead display a "copy code" button that copies the authorization context encoded as a base64 string of the json blob that would typically be passed to the express server. The end user would then paste that base64 string into the terminal prompt where Amplify CLI is running to fetch the tokens.
Before:
After:
If the tokens are passed off via the express server, the express server kills the prompt. If the prompt is used to pass the base64 tokens along, the prompt promise kills the express server.
Issue #, if available
N/A
Description of how you validated changes
Both paths work as expected.
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.