Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
d1f13c74
Unverified
Commit
d1f13c74
authored
4 years ago
by
Oliver Hanikel
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add an OpenID example config for Gitea. (#9134)
parent
8fee6a3a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/9134.doc
+1
-0
1 addition, 0 deletions
changelog.d/9134.doc
docs/openid.md
+34
-0
34 additions, 0 deletions
docs/openid.md
with
35 additions
and
0 deletions
changelog.d/9134.doc
0 → 100644
+
1
−
0
View file @
d1f13c74
Add docs for using Gitea as OpenID provider.
This diff is collapsed.
Click to expand it.
docs/openid.md
+
34
−
0
View file @
d1f13c74
...
@@ -353,3 +353,37 @@ Relevant documents:
...
@@ -353,3 +353,37 @@ Relevant documents:
*
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
*
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
*
Using Facebook's Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/
*
Using Facebook's Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/
*
Reference to the User endpoint: https://developers.facebook.com/docs/graph-api/reference/user
*
Reference to the User endpoint: https://developers.facebook.com/docs/graph-api/reference/user
### Gitea
Gitea is, like Github, not an OpenID provider, but just an OAuth2 provider.
The
[
`/user` API endpoint
](
https://try.gitea.io/api/swagger#/user/userGetCurrent
)
can be used to retrieve information on the authenticated user. As the Synapse
login mechanism needs an attribute to uniquely identify users, and that endpoint
does not return a
`sub`
property, an alternative
`subject_claim`
has to be set.
1.
Create a new application.
2.
Add this Callback URL:
`[synapse public baseurl]/_synapse/oidc/callback`
Synapse config:
```
yaml
oidc_providers
:
-
idp_id
:
gitea
idp_name
:
Gitea
discover
:
false
issuer
:
"
https://your-gitea.com/"
client_id
:
"
your-client-id"
# TO BE FILLED
client_secret
:
"
your-client-secret"
# TO BE FILLED
client_auth_method
:
client_secret_post
scopes
:
[]
# Gitea doesn't support Scopes
authorization_endpoint
:
"
https://your-gitea.com/login/oauth/authorize"
token_endpoint
:
"
https://your-gitea.com/login/oauth/access_token"
userinfo_endpoint
:
"
https://your-gitea.com/api/v1/user"
user_mapping_provider
:
config
:
subject_claim
:
"
id"
localpart_template
:
"
{{
user.login
}}"
display_name_template
:
"
{{
user.full_name
}}"
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment