Do I need to expose Vikunja to the Public for Todoist Migration?

Do I need to expose Vikunja to the Public for Todoist Migration?

migration:
  todoist:
    # Wheter to enable the todoist migrator or not
    enable: true
    # The client id, required for making requests to the todoist api
    # You need to register your vikunja instance at https://developer.todoist.com/appconsole.html to get this
    clientid:
    # The client secret, also required for making requests to the todoist api
    clientsecret:
    # The url where clients are redirected after they authorized Vikunja to access their todoist items.
    # This needs to match the url you entered when registering your Vikunja instance at todoist.
    # This is usually the frontend url where the frontend then makes a request to /migration/todoist/migrate
    # with the code obtained from the todoist api.
    # Note that the vikunja frontend expects this to be /migrate/todoist
    redirecturl: <frontend url>/migrate/todoist

The parameters clientid and clientsecret suggests that it needs to be indeed public.
So todoist migration is not possible when just self-hosting locally?

I don’t know about their requirements for registering new apps. You will need to register your installation so that it can use the api to pull in the tasks.

Your installation needs to be able to access Todoist’s api, but the authorization token when doing the migration happens via a redirect in the browser.

Just try it, I’ve never tested it with an instance that wasn’t public.

So I do get an error:

{"error":"redirect_uri_not_configured"}

on the new browser tab after clicking “Get Started” on Vikunja Frontend. I have the Icon and everything available on the Frontend

In both Vikunja Config and Todoist I have following redirecturl:

http://vikunja.home/migrate/todoist

Which makes totally sense, because how would todoist perform Oauth on a Local Domain?
So I think manual work is required :frowning:

In Todoist?

That should work, because it will redirect you in the browser to the Vikunja with the challenge attached as query param. Vikunja will then take that challenge and make a call to Todoist’s api to exchange it for a valid api token and then use that for the migration.

in the URL after clicking “Get Started” button on Vikunja Frontend, which is:
https://todoist.com/oauth/authorize?client_id=[...] (I’ve deleted the rest of url)

But If you say It’s possible then I’ll tinker with it more

EDIT: OKAY IT WORKED xd

I just had to specify my Oauth Redirect URL with https instead of http (even though I don’t have it on my local environment)
And later, when the redirect from Todoist to Vikunja happened I had to change https to http (in the browser URL, not in Todoist website)

1 Like