[GH-ISSUE #890] Add ability to unlink connected Oauth Accounts #580

Open
opened 2026-03-02 11:51:02 +03:00 by kerem · 5 comments
Owner

Originally created by @MichaelBrunn3r on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/890

I have an existing account michael that I used to test out Hoarder. This user can already login via my personal Authentik account. Now I want to create an additional admin user, that can login with my admin account in Authentik.

It seems I must have at one point accidentally logged in with my Authenik admin account into Hoarder. Now the michael Hoarder account is linked to both my admin AND personal account in Authentik. How can I remove that connection?

I already tried re-creating the provider in Authentik and changing its admin e-mail, but nothing seems to work. I guess I have to edit the database directly? How would I do that?

Originally created by @MichaelBrunn3r on GitHub (Jan 16, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/890 I have an existing account `michael` that I used to test out Hoarder. This user can already login via my personal Authentik account. Now I want to create an additional `admin` user, that can login with my admin account in Authentik. It seems I must have at one point accidentally logged in with my Authenik admin account into Hoarder. Now the `michael` Hoarder account is linked to both my admin AND personal account in Authentik. How can I remove that connection? I already tried re-creating the provider in Authentik and changing its admin e-mail, but nothing seems to work. I guess I have to edit the database directly? How would I do that?
Author
Owner

@kamtschatka commented on GitHub (Jan 16, 2025):

i'd try deleting that account again in the admin settings and create it again

<!-- gh-comment-id:2596183078 --> @kamtschatka commented on GitHub (Jan 16, 2025): i'd try deleting that account again in the admin settings and create it again
Author
Owner

@MichaelBrunn3r commented on GitHub (Jan 16, 2025):

Which account? My personal account or the new admin account? My personal account already has a lot of bookmarks on it, I would like to avoid starting from scratch, but I guess I could just make a backup first and then give the AI some work once I add it again? Does the backup/export include RSS feeds, lists and tags?

I already tried removing the newly added admin account, didn't help. Logging in to Hoarder after removing the provider in Authentik prompts me to re-link, but it seems to remember which Authentik accounts were previously linked.

<!-- gh-comment-id:2596751407 --> @MichaelBrunn3r commented on GitHub (Jan 16, 2025): Which account? My personal account or the new admin account? My personal account already has a lot of bookmarks on it, I would like to avoid starting from scratch, but I guess I could just make a backup first and then give the AI some work once I add it again? Does the backup/export include RSS feeds, lists and tags? I already tried removing the newly added admin account, didn't help. Logging in to Hoarder after removing the provider in Authentik prompts me to re-link, but it seems to remember which Authentik accounts were previously linked.
Author
Owner

@MohamedBassem commented on GitHub (Jan 18, 2025):

@MichaelBrunn3r I think this is an oversight from us to not have a way to "unlink" Oauth accounts. Are you comfortable with using CLIs? If you are, you should be able to:

  1. Go to the data directory of hoarder.
  2. Run sqlite3 db.db to open a shell against the database.
  3. Run delete from account; which will unlink all currently connected oauth accounts and allow you to reconnect more accounts;

Please ensure you take a database backup (just copy the database file) before doing the above query in case something goes wrong.

<!-- gh-comment-id:2599952418 --> @MohamedBassem commented on GitHub (Jan 18, 2025): @MichaelBrunn3r I think this is an oversight from us to not have a way to "unlink" Oauth accounts. Are you comfortable with using CLIs? If you are, you should be able to: 1. Go to the data directory of hoarder. 2. Run `sqlite3 db.db` to open a shell against the database. 3. Run `delete from account;` which will unlink all currently connected oauth accounts and allow you to reconnect more accounts; Please ensure you take a database backup (just copy the database file) before doing the above query in case something goes wrong.
Author
Owner

@MichaelBrunn3r commented on GitHub (Jan 18, 2025):

Awesome, a CLI options is all I need right now, I will test it out tomorrow and write back if there are any problems.
And thanks for labeling this as a feature request to improve the UX for anyone in the future that might have the same issue.

<!-- gh-comment-id:2600117644 --> @MichaelBrunn3r commented on GitHub (Jan 18, 2025): Awesome, a CLI options is all I need right now, I will test it out tomorrow and write back if there are any problems. And thanks for labeling this as a feature request to improve the UX for anyone in the future that might have the same issue.
Author
Owner

@MichaelBrunn3r commented on GitHub (Jan 19, 2025):

Great, it worked. But I didn't have to link my accounts, I was automatically logged into the correct accounts. My Authentik provider is configure to ask for explicit consent to link an account, but I guess since I only reset the Hoarder Database and not the Authentik one, consent was already given from my previous failed attempts.

<!-- gh-comment-id:2600890490 --> @MichaelBrunn3r commented on GitHub (Jan 19, 2025): Great, it worked. But I didn't have to link my accounts, I was automatically logged into the correct accounts. My Authentik provider is configure to ask for explicit consent to link an account, but I guess since I only reset the Hoarder Database and not the Authentik one, consent was already given from my previous failed attempts.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#580
No description provided.