Skip to content

Linking OIDC with existing account fails with 500 #35995

@achikhv

Description

@achikhv

Description

Hello!

I tried to add keycloak as authentication source for gitea. I already have users inside gitea, so I added a user with the same email to keycloak's realm.

I configured gitea to use my keycloak as authentication source. Then I was able to login with, and then I got redirected to gitea's link existing account page.

Image

After I provide valid password I get 500 error:

Image

There is a record in logs:

2025/11/21 10:01:12 .../web/auth/linkaccount.go:190:oauth2LinkAccount() [E] UserLinkAccount: mssql: String or binary data would be truncated.

Maybe I can edit database schema manually and increase field size? Will it work, or some fixes in codebase are required?

Gitea Version

1.25.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2025/11/21 10:01:12 .../web/auth/linkaccount.go:190:oauth2LinkAccount() [E] UserLinkAccount: mssql: String or binary data would be truncated.

Screenshots

No response

Git Version

No response

Operating System

Windows server 2019

How are you running Gitea?

Runs as windows service from binary.

Database

MSSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions