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

Mastodon OAuth2 Provider #12897

Closed
OmmyZhang opened this issue Sep 19, 2020 · 3 comments
Closed

Mastodon OAuth2 Provider #12897

OmmyZhang opened this issue Sep 19, 2020 · 3 comments
Labels
good first issue Likely to be an easy fix hacktoberfest type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Milestone

Comments

@OmmyZhang
Copy link

I hope gitea can configure custom OAuth2 Provider instead of only provide limited choices.
With custom authorizeUrl, tokenUrl, profileURL, scopes , subjectClaim( it's sub for oidc) and usernameTemplate, almost any OAuth2/OpenId can work. (That's how synapse porject does)

My problem is that I want to use Mastodon as OAuth2 Provider but failed, but I think this feature can be widely useful.

@techknowlogick
Copy link
Member

OAuth2 itself is implemented with many differences between providers, we use https://github.com/markbates/goth/tree/master/providers for connecting to various providers, and as you can see there are many listed there as they are all implemented differently. If you'd like Mastodon to be implemented please open an issue/PR upstream, and once supported we'd be happy to add support.

@techknowlogick techknowlogick added the type/upstream This is an issue in one of Gitea's dependencies and should be reported there label Sep 19, 2020
@techknowlogick techknowlogick changed the title Custom OAuth2 Provider Mastodon OAuth2 Provider Oct 18, 2020
@techknowlogick
Copy link
Member

Re-opening as Goth now supports Mastodon as an OAuth2 provider, which means with a PR we can support Mastodon as well

@techknowlogick techknowlogick added good first issue Likely to be an easy fix hacktoberfest type/feature Completely new functionality. Can only be merged if feature freeze is not active. and removed type/upstream This is an issue in one of Gitea's dependencies and should be reported there labels Oct 18, 2020
techknowlogick added a commit that referenced this issue Oct 25, 2020
* added mastodon provider to oauth code

* changed go.mod and vendor/modules.txt to add updated goth

* vendored mastodon and new goth

* committing result of go mod tidy && go mod vendor

* added pic and mastodon to oauth models

* handled instance url

* applied lafriks suggestion

* Update web_src/js/index.js

Co-authored-by: techknowlogick <matti@mdranta.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
@techknowlogick
Copy link
Member

Closed per linked PR

@lafriks lafriks added this to the 1.14.0 milestone Oct 26, 2020
ivanvc added a commit to ivanvc/gitea that referenced this issue Oct 27, 2020
…s-stored-in-email-address-table

* origin/master:
  [UI] Hide consecutive additions and removals of the same label (go-gitea#13315)
  [skip ci] Updated translations via Crowdin
  Fix send mail (go-gitea#13312)
  [skip ci] Updated translations via Crowdin
  Deny wrong pull (go-gitea#13308)
  Group Label Changed Comments in timeline (go-gitea#13304)
  [skip ci] Updated translations via Crowdin
  Attempt to handle unready PR in tests (go-gitea#13305)
  go-gitea#12897 - add mastodon provider (go-gitea#13293)
  [skip ci] Updated translations via Crowdin
  Fix Storage mapping (go-gitea#13297)
  Update Mirror IsEmpty status on synchronize (go-gitea#13185)
  Fix bug isEnd detection on getIssues/getPullRequests (go-gitea#13299)
  systemd service: Add commented PATH environment option for Git prefix (go-gitea#13170)
  Sendmail command (go-gitea#13079)
  Various UI and arc-green fixes (go-gitea#13291)
@go-gitea go-gitea locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Likely to be an easy fix hacktoberfest type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

No branches or pull requests

3 participants