- Newest
- Most votes
- Most comments
There's no confirmed AWS Sign-In service issue matching this. GitHub issue #10186 is still open, labelled bug, login, p2 and service-api, with no root cause or workaround posted. It describes the same symptom: a 400 shown in the browser and the localhost callback never reached. In that report, the trigger was stale console session cookies. Since you see the 400 even in a fresh InPrivate window, your case may have a different cause.
1. Is this a known issue?
Partly. Issue #10186 shows that the authorize endpoint returns a plain 400 to the browser instead of redirecting with an OAuth error parameter. As a result, the CLI only reports a timeout and the real reason is hidden. Nothing public covers your exact case (Windows, fresh session, ap-southeast-1).
2. Endpoint and permission checks
- Region. Make sure the region in the profile used by
aws login(aws configure get region) is the same as the host in the authorize URL (signin.ap-southeast-1.amazonaws.com), and that the resource ARN in your policy uses that same region. Also tryus-east-1to rule out a regional problem. - Permissions. As a baseline, attach the AWS managed policy
SignInLocalDevelopmentAccess. If you use a custom policy, the resource foraws loginmust bearn:aws:signin:<region>:<account-id>:oauth2/public-client/localhost. The--remoteflow uses.../oauth2/public-client/remote. - Policies Access Analyzer doesn't evaluate. Policy validation in Access Analyzer doesn't check SCPs, RCPs or permission boundaries. Check whether any of these deny
signin:*or restrict regions withaws:RequestedRegion.
3. Diagnosing without exposing secrets
- Browser DevTools (F12 → Network, with "Preserve log" on): reproduce the error and find the request that returns 400. Note only the host, path, status code and any
errororerror_descriptionvalue in the response or redirect. Don't share cookies,codevalues or full URLs. - Missing URL parameters on Windows: on Windows, URLs launched through the shell are sometimes cut off at the first
&, which would produce exactly this 400. Compare the URL in the Edge address bar with the one the CLI prints. Check that only the parameter names are all present:response_type,client_id,redirect_uri,code_challenge,code_challenge_method,stateand so on. If any are missing, paste the full printed URL into the browser yourself. - Use
--remote: runaws login --remote, which needs theremoteresource ARN. It avoids the localhost redirect. If it works, the problem is the local callback, browser launch or redirect, not your identity or policy. - Isolate the cause: try another browser (Chrome or Firefox), another network (no corporate proxy or TLS inspection), and briefly another principal with admin rights.
aws login --debug: shows what the CLI builds and sends. Redactstate,code_challengeand anything token-like before sharing.- CloudTrail: Sign-In events are often logged in
us-east-1as well as the sign-in region, so check both. A request rejected as malformed before authentication may not be logged at all, which would itself point to a malformed request rather than a permissions problem.
4. Workarounds that keep MFA and avoid long-term keys
aws login --remote: same mechanism, different redirect path.- IAM Identity Center (
aws configure sso): this is AWS's recommended path for human CLI access. It enforces MFA and issues short-lived credentials, and it doesn't depend on theaws loginflow. - AWS CloudShell: gives you a CLI from the console session immediately, using the console's MFA-backed credentials.
If none of this isolates the cause, open an AWS Support case for the Sign-In service. Include the CLI version, the region, the timestamp and the host and path of the 400 request from DevTools. You could also add a comment to #10186 noting that it reproduces in a fresh session on Windows.
Sources:
Relevant content
asked a year ago

Hi Takahiro,
Thank you for your detailed and helpful explanation.
I would like to investigate this issue more deeply and identify the actual failure point before changing any IAM permissions or security configuration.
My environment and symptoms:
aws loginproduces HTTP 400 Bad Request during browser-based OAuth authorizationI have seven follow-up questions.
1. Exact OAuth failure stage
How can we determine whether HTTP 400 originates from initial
/authorizerequest validation, AWS Sign-In session handling, IAM authorization, or another part of the OAuth flow?Are there specific response headers, error codes, request IDs, or redirect patterns that distinguish these cases?
2. IAM denial versus malformed OAuth request
Can an explicit IAM Deny, permission boundary, or SCP cause the AWS Sign-In authorization endpoint to return HTTP 400 instead of 403 or an OAuth
access_deniederror?If so, what evidence would distinguish an IAM authorization failure from malformed OAuth parameters?
3. Fresh browser session still fails
Since the same HTTP 400 occurs in a new InPrivate browser session, what other known causes should we investigate besides sta