Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login with Gitea OAuth problems: external user ID not properly recorded #514

Closed
gytisrepecka opened this issue Nov 28, 2021 · 3 comments
Closed
Labels
Milestone

Comments

@gytisrepecka
Copy link
Contributor

Describe the bug

When Gitea OAuth is used for logging in, external user ID is not properly recorded in oauth_users.remote_user_id which causes misbehavior when logging in with different external users from Gitea server.

Steps to reproduce

Steps to reproduce the behavior:

  1. Login to WriteFreely with user_a;
  2. Associate user_a with Gitea user gitea_user_a;
  3. Login to WriteFreely with user_b;
  4. Associate user_b with Gitea user gitea_user_b;
  5. Attempt to login with Gitea user gitea_user_b - you will be logged in as user_a while it is expected to be user_b.

Expected behavior

Expected behavior is logging in with gitea_user_a logs into user_a while gitea_user_b logs into user_b.

Application configuration

  • Single mode or Multi-user mode? Multi-user
  • Database? [mysql/sqlite] MySQL
  • Open registration? [yes/no] Yes and No
  • Federation enabled? [yes/no] Yes

Version or last commit: v0.13.1

To solve this issue it is required to add extra auth fields into Gitea implementation code in the same way as they are available in oauth_generic.go. Pull request will be submitted in a moment.

@gytisrepecka
Copy link
Contributor Author

This is very related to #469.

gytisrepecka added a commit to gytisrepecka/writefreely that referenced this issue Nov 28, 2021
@thebaer thebaer added the bug label Dec 2, 2021
@gytisrepecka
Copy link
Contributor Author

Pull Request fixes the problem, running for a while now in production. Can it be merged?

@thebaer thebaer added this to the 0.13.2 milestone Jan 27, 2022
thebaer added a commit that referenced this issue Jan 28, 2022
#514 - Fix login with Gitea OAuth: external user ID not recorded
@thebaer
Copy link
Member

thebaer commented Jan 28, 2022

Fixed in #515

@thebaer thebaer closed this as completed Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants