Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

"Authentication fails on Linux - token exchange not completing"

Open mikiedelsteinspiral opened this issue 1 year ago • 14 comments

Before opening, please confirm:

Operating System

Kubuntu 24.04

Kiro Version

kiro-ide-0.6.32-stable-linux-x64

Bug Description

When trying to authenticate Kiro opens up the browser and when authenticating it hangs on "URL handler". Tried all suggested fixes but nothing worked.

Logs suggest " 2025-12-01 09:33:55.023 [error] MISSING_TOKEN: No valid token found 2025-12-01 09:33:55.351 [error] Failed to retrieve auth token: No valid token found" .

Steps to Reproduce

Tried everything that was suggested here: https://github.com/kirodotdev/Kiro/issues/3782#issuecomment-3564488212 Tried debugging with all AI tools to no avail.

Expected Behavior

Authenticate and open the IDE successfully

Conversation ID

No response

Additional Context

No response

mikiedelsteinspiral avatar Dec 01 '25 07:12 mikiedelsteinspiral

Also experiencing this on Manjaro KDE

Environment:

  • OS: Manjaro Linux (Kernel 6.12.48-1-MANJARO)
  • Desktop: KDE Plasma
  • Kiro Version: 0.7.21-stable-linux-x64

Same symptoms:

  • OAuth completes in browser successfully
  • Browser redirects to kiro://kiro.kiroagent/authenticate-success?code=...&state=...
  • Extension host crashes with MISSING_TOKEN: No valid token found
  • Second splash screen appears showing only "Cancel" button - no way to proceed

Both Google AND GitHub authentication fail identically.

Additional debugging performed:

  • Verified URL handler IS being called correctly (confirmed via debug logs)
  • Created proper .desktop file with x-scheme-handler/kiro
  • Registered with xdg-mime and KDE protocol handler
  • Tested with --open-url flag
  • Tried opening workspace before authentication (kiro ~/kiro-workspace)

Full error logs from ~/.config/Kiro/logs/*/window1/exthost/exthost.log:

[error] MISSING_TOKEN: No valid token found
[error] CodeExpectedError: Unable to write to Workspace Settings because no workspace is opened.
[info] Extension host terminating: renderer closed the MessagePort
[info] Extension host with pid XXXXX exiting with code 0

Console output:

[main 2025-12-06T07:32:11.709Z] update#setState idle
libva error: /usr/lib/dri/i965_drv_video.so init failed
[main 2025-12-06T07:32:27.653Z] Extension host with pid 1096200 exited with code: 0, signal: unknown.
[main 2025-12-06T07:32:27.685Z] [UtilityProcess id: 1, type: fileWatcher, pid: 1096289]: crashed with code 15 and reason 'killed'

Root cause: The kiro:// URL handler works correctly, but Kiro's extension host fails to process the OAuth callback token on KDE-based Linux distributions.

This is a CRITICAL blocker - completely unable to use Kiro on this system.

SvenMeyer avatar Dec 06 '25 07:12 SvenMeyer

Image

SvenMeyer avatar Dec 06 '25 07:12 SvenMeyer

✅ WORKAROUND FOUND!

Solution: Use "Sign in with AWS Builder ID" instead of direct Google/GitHub OAuth.

Steps:

  1. On Kiro's authentication splash screen, select "Sign in with AWS Builder ID" (instead of Google/GitHub)
  2. In the browser, authenticate to AWS (you can use Google to sign in to AWS)
  3. AWS redirects back to Kiro successfully
  4. Authentication completes! ✅

This bypasses the broken direct OAuth flow on Linux and works perfectly.

The direct Google/GitHub OAuth is still broken and should be fixed, but this workaround allows Linux users to use Kiro in the meantime.

Image

SvenMeyer avatar Dec 06 '25 07:12 SvenMeyer

Correction: This affects multiple Linux distributions and desktop environments, not just KDE. Similar issues reported on:

  • Kubuntu (KDE)
  • Manjaro (KDE)
  • Fedora (GNOME)
  • Linux Mint (Cinnamon)

The issue appears to be a broader Linux OAuth callback handling problem in Kiro's extension host.

SvenMeyer avatar Dec 06 '25 07:12 SvenMeyer

✅ WORKAROUND FOUND!

Solution: Use "Sign in with AWS Builder ID" instead of direct Google/GitHub OAuth.

Steps:

  1. On Kiro's authentication splash screen, select "Sign in with AWS Builder ID" (instead of Google/GitHub)
  2. In the browser, authenticate to AWS (you can use Google to sign in to AWS)
  3. AWS redirects back to Kiro successfully
  4. Authentication completes! ✅

This bypasses the broken direct OAuth flow on Linux and works perfectly.

The direct Google/GitHub OAuth is still broken and should be fixed, but this workaround allows Linux users to use Kiro in the meantime.

Image

Yep, that actually worked. Too bad the others didn't and on so many platforms.

mikiedelsteinspiral avatar Dec 07 '25 10:12 mikiedelsteinspiral

Hi @mikiedelsteinspiral , are you still unable to log in with Google/GitHub on Linux? If so, can you please let me know if you are installing the linux .deb file or running Kiro from the standalone .tar.gz file?

awschristou avatar Dec 11 '25 00:12 awschristou

awchristou Arch Linux It doesn't matter if it's aur kiro-ide or standalone.tar.gz I can only log in with my AWS Builder ID, but I lost my paid credits (960) and got 500 back in the free plan.

kzolti avatar Dec 12 '25 17:12 kzolti

Hi,

I had the same issue in Kubuntu and Aurora Linus (Fedora Kinoite).

In my case Kiro was trying to open a xdg-open callback, which failed.

I did the following and managed to login using Google in Aurora (Fedora). I have not yet tried this in Kubuntu.

  1. Create a ~/.local/share/applications/kiro.desktop:
[Desktop Entry]
Type=Application
Name=Kiro
Exec=/var/home/daco/Downloads/Kiro/kiro --open-url %u
MimeType=x-scheme-handler/kiro;
NoDisplay=true
Terminal=false
StartupNotify=false

Change /var/home/daco/Downloads/Kiro/kiro with the path to your bin. In this case I just downloaded the tar.gz from kiro.dev and extracted it to my Download Folder.

The important part is --open-url %u

Then run

update-desktop-database ~/.local/share/applications/

After that I started Kiro, used the Google Button to login, and it asked to open the XDG-OPEN, and it worked.

I hope that helps!

dacog avatar Dec 12 '25 18:12 dacog

https://github.com/kirodotdev/Kiro/issues/4130#issuecomment-3647604386

It doesn't work, I can still only log in with my AWS Builder ID, but I don't see my subscription credits there. I got 500 credits again as a free user. I have 2 desktop files: kiro-url-handler.desktop kiro.desktop These seem to work fine.

kzolti avatar Dec 13 '25 11:12 kzolti

Hi @mikiedelsteinspiral , are you still unable to log in with Google/GitHub on Linux? If so, can you please let me know if you are installing the linux .deb file or running Kiro from the standalone .tar.gz file?

Hi, still and with both installations.

mikiedelsteinspiral avatar Dec 15 '25 09:12 mikiedelsteinspiral

thanks @dacog ,it works on fedora 43(kde), don't use chrome(dosn't work),use firefox

In KDE Plasma environment, additional configuration steps are required to make custom URL protocols work properly. Here's the complete solution for KDE:

1. Create the .desktop file (same as before)

mkdir -p ~/.local/share/applications
nano ~/.local/share/applications/kiro.desktop

Content:

[Desktop Entry]
Type=Application
Name=Kiro
Exec=/var/home/daco/Downloads/Kiro/kiro --open-url %u
MimeType=x-scheme-handler/kiro;
Terminal=false
StartupNotify=false

Note: Modify the Exec path to match your actual Kiro executable path

2. Update desktop database

update-desktop-database ~/.local/share/applications/

3. KDE-specific configuration - Register protocol handler

In KDE, additional protocol association configuration is needed. Edit the following file:

nano ~/.config/kioslaverc

Add the following content:

[Protocol Settings]
kiro=kiro

4. KDE-specific configuration - MIME type association

Create the MIME type configuration file:

mkdir -p ~/.local/share/mime/packages
nano ~/.local/share/mime/packages/kiro.xml

Content:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="x-scheme-handler/kiro">
    <comment>Kiro Protocol Handler</comment>
  </mime-type>
</mime-info>

Then update the MIME database:

update-mime-database ~/.local/share/mime

5. KDE-specific configuration - Default applications

Configure manually in KDE System Settings:

  1. Open "System Settings" → "Applications" → "Default Applications"
  2. Find the "URI Associations" or "Protocol Associations" section
  3. Search for "kiro" protocol
  4. Select "kiro.desktop" as the handler

Or use the command line:

kwriteconfig5 --file kdeglobals --group "General" --key "BrowserApplication" "kiro.desktop"

6. Verify KDE protocol handling

In KDE, you can test protocol handling using kioclient5:

kioclient5 exec "kiro://test"

7. If it still fails - Check KDE service menu

Sometimes KDE ignores the NoDisplay=true setting. Try removing that line:

[Desktop Entry]
Type=Application
Name=Kiro
Exec=/var/home/daco/Downloads/Kiro/kiro --open-url %u
MimeType=x-scheme-handler/kiro;
Terminal=false
StartupNotify=false

8. Final verification steps

  1. Restart KDE session (log out and back in)
  2. Test in terminal:
    xdg-open "kiro://test"
    kioclient5 exec "kiro://test"
    
  3. Try Kiro login

Important notes

  • KDE's protocol handling is stricter than GNOME and requires complete MIME type registration
  • Ensure the Kiro application path is correct and has execute permissions
  • If using Flatpak or Snap installed browsers, additional permission configuration may be needed
  • In KDE, kioclient5 is the standard tool for handling URLs and is more reliable than xdg-open

If the above steps still don't resolve the issue, check Kio logs:

journalctl -f | grep -i kio

KDE environment typically requires more detailed protocol registration configuration than other desktop environments because its components (KIO slaves) have their own independent protocol handling mechanisms.

Hi,

I had the same issue in Kubuntu and Aurora Linus (Fedora Kinoite).

In my case Kiro was trying to open a xdg-open callback, which failed.

I did the following and managed to login using Google in Aurora (Fedora). I have not yet tried this in Kubuntu.

  1. Create a ~/.local/share/applications/kiro.desktop:
[Desktop Entry]
Type=Application
Name=Kiro
Exec=/var/home/daco/Downloads/Kiro/kiro --open-url %u
MimeType=x-scheme-handler/kiro;
NoDisplay=true
Terminal=false
StartupNotify=false

Change /var/home/daco/Downloads/Kiro/kiro with the path to your bin. In this case I just downloaded the tar.gz from kiro.dev and extracted it to my Download Folder.

The important part is --open-url %u

Then run

update-desktop-database ~/.local/share/applications/ After that I started Kiro, used the Google Button to login, and it asked to open the XDG-OPEN, and it worked.

I hope that helps!

cognifyi avatar Dec 22 '25 11:12 cognifyi

it works on fedora 43(kde), don't use chrome(dosn't work),use firefox

This, I finally I got it working with Firefox

qduc avatar Jan 02 '26 05:01 qduc

https://github.com/kirodotdev/Kiro/issues/4130#issuecomment-3619706102

Using the "Sign in with AWS Builder ID" solved it for me as well, but it a far from ideal. For testing Kiro it is sufficient for now, but as soon as I need to switch to a pro account, my employer isn't likely to accept this...

I am on Arch Linux / KDE

veger avatar Jan 26 '26 13:01 veger

Hi, this Linux OAuth deep-link issue has been addressed. CLI 2.1 (Apr 24, 2026) introduced Device Flow authentication which works on all Linux environments without requiring the kiro: URI scheme or browser deep-linking.

Run kiro-cli login and it will display a URL + one-time code you can enter in any browser. See: https://kiro.dev/docs/cli/authentication/#device-flow-recommended

For the IDE, subsequent releases (0.9+) also improved OAuth handling. If you're still experiencing issues on the latest version, please open a new issue.

Closing as resolved.

AnilMaktala avatar May 21 '26 12:05 AnilMaktala