一、安装keyCloak

二、配置KeyCloak,添加Clients
Clients -> create
Client ID: devops-oidc
Enabled: true
Client Protocol: openid-connect
Access Type: confidential
Valid Redirect URIs: /*

三、配置Gitea,添加Authentication Sources
Site Administration -> Authentication Sources -> Add Authentication Source
OAuth2 Provider: OpenID Connect
Client ID(key): devops-oidc
Client Secret: <keycload 中 devops-oidc Credentials中查询>
OpenID Connect Auto Discovery URL: http:///auth/realms/master/.well-known/openid-configuration

gitea app.ini
ALLOW_ONLY_EXTERNAL_REGISTRATION = true