A way to see users blocking deletion of authentication source #8536

Open
opened 2025-11-02 08:10:11 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @adyanth on GitHub (Feb 9, 2022).

Feature Description

I recently added an OIDC source to test out. I uninstalled the provider and forgot about it.
When I was looking through and performing cleanup, I was not able to delete the authentication source from the Gitea Admin page. It kept complaining about source still in use. I was not able to see which user was using the auth source for me to go and delete that.

I went through the code + DB trying to find what was the row that it thought was causing the issue. I did not see any user using the login_source set to the one I was trying to delete. I was about to file a bug, but the logging doc talks about enabling SQL logging. Enabling it and trying to delete, I found the table external_login_user which listed my username as bound to the auth source I wanted gone.

Then came the task of hunting what to do to get the entry deleted. Found that shortly under linked accounts in user settings albeit with three entries having the same name (!!). Deleting one on a hunch turned right and I was able to delete the auth source.

The feature request: Can this be made any simpler? To see a list of users using an auth source and for an admin to forcefully unbind the auth source and delete it without messing directly on the DB?

Screenshots

No response

Originally created by @adyanth on GitHub (Feb 9, 2022). ### Feature Description I recently added an OIDC source to test out. I uninstalled the provider and forgot about it. When I was looking through and performing cleanup, I was not able to delete the authentication source from the Gitea Admin page. It kept complaining about source still in use. I was not able to see which user was using the auth source for me to go and delete that. I went through the code + DB trying to find what was the row that it thought was causing the issue. I did not see any user using the login_source set to the one I was trying to delete. I was about to file a bug, but the logging doc talks about enabling SQL logging. Enabling it and trying to delete, I found the table `external_login_user` which listed my username as bound to the auth source I wanted gone. Then came the task of hunting what to do to get the entry deleted. Found that shortly under linked accounts in user settings albeit with three entries having the same name (!!). Deleting one on a hunch turned right and I was able to delete the auth source. The feature request: Can this be made any simpler? To see a list of users using an auth source and for an admin to forcefully unbind the auth source and delete it without messing directly on the DB? ### Screenshots _No response_
GiteaMirror added the topic/uitype/proposal labels 2025-11-02 08:10:11 -06:00
Author
Owner

@dmitrygribenchuk commented on GitHub (Apr 2, 2024):

Hello. I have tha same issue and can add a screenshot
image

@dmitrygribenchuk commented on GitHub (Apr 2, 2024): Hello. I have tha same issue and can add a screenshot ![image](https://github.com/go-gitea/gitea/assets/15670247/45847542-d59a-49c7-9307-8964d99729ce)
Author
Owner

@lunny commented on GitHub (Apr 2, 2024):

Maybe we can have an checkbox option to allow removing all the binding from users to this with source.

@lunny commented on GitHub (Apr 2, 2024): Maybe we can have an checkbox option to allow removing all the binding from users to this with source.
Author
Owner

@CRCinAU commented on GitHub (Jul 4, 2025):

Yeah, I just hit this too.... Was playing with Authentik - decided not to keep it - but now I can't remove it from my Authentication Sources due to the same error

@CRCinAU commented on GitHub (Jul 4, 2025): Yeah, I just hit this too.... Was playing with Authentik - decided not to keep it - but now I can't remove it from my Authentication Sources due to the same error
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8536