UI Authorization
October 2, 2020 ยท View on GitHub
By default, there is no authorization (anonymous user will be used).
If list of auth.users is not empty, all authorized users will be allowed.
OAuth2
This is mostly recommended way
Defined in the section: auth.oauth2
title- text that will be used for login buttonsecret- OAuth2 client secretkey- OAuth2 client IDcallback_url- redirect URL, must point to your sever plus/ui/auth/oauth2/callbackauth_url- authenticate URL, different for each providertoken_url- issue token URL, different for each providerprofile_url(optional) - URL that should return user JSON profile on GET request with authorization by token; if not defined login will an empty stringlogin_field- (required only ifprofile_urlset) filed name (should be string) in profile that identifies user (ex:login,usernameoremail)scopes(optional) - list of OAuth2 scopes
Gitea example:
auth:
oauth2:
title: Gitea
secret: "oauth secret"
key: "oauth key"
callback_url: "https://YOUR-SERVER/ui/auth/oauth2/callback"
auth_url: "https://gitea-server/login/oauth/authorize"
token_url: "https://gitea-server/login/oauth/access_token"
profile_url: "https://gitea-server/api/v1/user"
login_field: "login"
scopes:
- nano-run
users:
- "reddec"