Exafunction / codeium.nvim

A native neovim extension for Codeium
MIT License
644 stars 50 forks source link

Can't authenticate with corporate instance #137

Closed jvolante closed 4 months ago

jvolante commented 5 months ago

NeoVim version: v0.10.0-dev (nightly) OS: Ubuntu 22.04.3 LTS

I'm trying to use this plugin with a corporate instance, I've installed the plugin via Lazy

My Codeium setup looks like this:

require('codeium').setup {
  api = {
    host = "<my-corporate-instance-url>"
  },
  uname = 'uname',
  uuidgen = 'uuidgen',
  curl = 'curl',
  gzip = 'gzip',
}

The first issue, when I use Codeium Auth with this setup, I'm taken to the global codeium website to authenticate instead of the SSO for my company instance. I can fix this issue by changing line 70 in api.lua from

local url = "https://www.codeium.com/profile?response_type=token&redirect_uri=vim-show-auth-token&state="

to

local url = "https://<my-corporate-url>/profile?response_type=token&redirect_uri=vim-show-auth-token&state="

This causes the plugin to take me to the correct sign on page, and I can receive and API token. Unfortunately when I enter the API token it isn't accepted. I'd imagine it has something to do with the io.post request on line 80 of api.lua, but I haven't been able to figure out the correct URL to use.

I hope there's a fix for this, I'd love to be able to use Codeium integrated into my cmp.nvim setup.

jvolante commented 5 months ago

At a second glance it looks like this is a duplicate of https://github.com/Exafunction/codeium.nvim/issues/113

I'm happy to open a ticket via the support channels to request this feature if that's still necessary.

consoleaf commented 4 months ago

This should be possible now, please check

jvolante commented 4 months ago

Looks like it's working! Thanks so much.