diff options
author | Willem van Dreumel <willemvd@users.noreply.github.com> | 2017-05-01 15:26:53 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-01 21:26:53 +0800 |
commit | 950f2e207413551b868252a1bced6ce9263d16d4 (patch) | |
tree | b01a330af11c7f8b9e2d1461685d9afb2ae9e485 /templates/admin | |
parent | 2368bbb6727ea5497743c0fdade723b49693cb4c (diff) | |
download | gitea-950f2e207413551b868252a1bced6ce9263d16d4.tar.gz gitea-950f2e207413551b868252a1bced6ce9263d16d4.zip |
Additional OAuth2 providers (#1010)
* add google+
* sort signin oauth2 providers based on the name so order is always the same
* update auth tip for google+
* add gitlab provider
* add bitbucket provider (and some go fmt)
* add twitter provider
* add facebook provider
* add dropbox provider
* add openid connect provider incl. new format of tips section in "Add New Source"
* lower the amount of disk storage for each session to prevent issues while building cross platform (and disk overflow)
* imports according to goimport and code style
* make it possible to set custom urls to gitlab and github provider (only these could have a different host)
* split up oauth2 into multiple files
* small typo in comment
* fix indention
* fix indentation
* fix new line before external import
* fix layout of signin part
* update "broken" dependency
Diffstat (limited to 'templates/admin')
-rw-r--r-- | templates/admin/auth/edit.tmpl | 33 | ||||
-rw-r--r-- | templates/admin/auth/new.tmpl | 25 | ||||
-rw-r--r-- | templates/admin/auth/source/oauth.tmpl | 37 |
3 files changed, 92 insertions, 3 deletions
diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index ea5104b79f..3c74b2ad17 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -164,6 +164,39 @@ <label for="oauth2_secret">{{.i18n.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{$cfg.ClientSecret}}" required> </div> + <div class="open_id_connect_auto_discovery_url required field"> + <label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{$cfg.OpenIDConnectAutoDiscoveryURL}}"> + </div> + + <div class="oauth2_use_custom_url inline field"> + <div class="ui checkbox"> + <label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox" {{if $cfg.CustomURLMapping}}checked{{end}}> + </div> + </div> + <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> + <label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label> + <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}v{{end}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_token_url required field"> + <label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label> + <input id="oauth2_token_url" name="oauth2_token_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.TokenURL}}{{end}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> + <label for="oauth2_profile_url">{{.i18n.Tr "admin.auths.oauth2_profileURL"}}</label> + <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.ProfileURL}}{{end}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_email_url required field"> + <label for="oauth2_email_url">{{.i18n.Tr "admin.auths.oauth2_emailURL"}}</label> + <input id="oauth2_email_url" name="oauth2_email_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.EmailURL}}{{end}}"> + </div> + {{if .OAuth2DefaultCustomURLMappings}}{{range $key, $value := .OAuth2DefaultCustomURLMappings}} + <input id="{{$key}}_token_url" value="{{$value.TokenURL}}" type="hidden" /> + <input id="{{$key}}_auth_url" value="{{$value.AuthURL}}" type="hidden" /> + <input id="{{$key}}_profile_url" value="{{$value.ProfileURL}}" type="hidden" /> + <input id="{{$key}}_email_url" value="{{$value.EmailURL}}" type="hidden" /> + {{end}}{{end}} {{end}} <div class="inline field {{if not .Source.IsSMTP}}hide{{end}}"> diff --git a/templates/admin/auth/new.tmpl b/templates/admin/auth/new.tmpl index a18a782fc1..00239b0462 100644 --- a/templates/admin/auth/new.tmpl +++ b/templates/admin/auth/new.tmpl @@ -80,8 +80,29 @@ <div class="ui attached segment"> <h5>GMail Settings:</h5> <p>Host: smtp.gmail.com, Port: 587, Enable TLS Encryption: true</p> - <h5>OAuth GitHub:</h5> - <p>{{.i18n.Tr "admin.auths.tip.github"}}</p> + + <h5>{{.i18n.Tr "admin.auths.tips.oauth2.general"}}:</h5> + <p>{{.i18n.Tr "admin.auths.tips.oauth2.general.tip"}}</p> + + <h5 class="ui top attached header">{{.i18n.Tr "admin.auths.tip.oauth2_provider"}}</h5> + <div class="ui attached segment"> + <li>Bitbucket</li> + <span>{{.i18n.Tr "admin.auths.tip.bitbucket"}}</span> + <li>Dropbox</li> + <span>{{.i18n.Tr "admin.auths.tip.dropbox"}}</span> + <li>Facebook</li> + <span>{{.i18n.Tr "admin.auths.tip.facebook"}}</span> + <li>GitHub</li> + <span>{{.i18n.Tr "admin.auths.tip.github"}}</span> + <li>GitLab</li> + <span>{{.i18n.Tr "admin.auths.tip.gitlab"}}</span> + <li>Google+</li> + <span>{{.i18n.Tr "admin.auths.tip.google_plus"}}</span> + <li>OpenID Connect</li> + <span>{{.i18n.Tr "admin.auths.tip.openid_connect"}}</span> + <li>Twitter</li> + <span>{{.i18n.Tr "admin.auths.tip.twitter"}}</span> + </div> </div> </div> </div> diff --git a/templates/admin/auth/source/oauth.tmpl b/templates/admin/auth/source/oauth.tmpl index 4d8e12e028..5d585c04dc 100644 --- a/templates/admin/auth/source/oauth.tmpl +++ b/templates/admin/auth/source/oauth.tmpl @@ -20,4 +20,39 @@ <label for="oauth2_secret">{{.i18n.Tr "admin.auths.oauth2_clientSecret"}}</label> <input id="oauth2_secret" name="oauth2_secret" value="{{.oauth2_secret}}"> </div> -</div> + <div class="open_id_connect_auto_discovery_url required field"> + <label for="open_id_connect_auto_discovery_url">{{.i18n.Tr "admin.auths.openIdConnectAutoDiscoveryURL"}}</label> + <input id="open_id_connect_auto_discovery_url" name="open_id_connect_auto_discovery_url" value="{{.open_id_connect_auto_discovery_url}}"> + </div> + + <div class="oauth2_use_custom_url inline field"> + <div class="ui checkbox"> + <label><strong>{{.i18n.Tr "admin.auths.oauth2_use_custom_url"}}</strong></label> + <input id="oauth2_use_custom_url" name="oauth2_use_custom_url" type="checkbox"> + </div> + </div> + <div class="oauth2_use_custom_url_field oauth2_auth_url required field"> + <label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label> + <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{.oauth2_auth_url}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_token_url required field"> + <label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label> + <input id="oauth2_token_url" name="oauth2_token_url" value="{{.oauth2_token_url}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_profile_url required field"> + <label for="oauth2_profile_url">{{.i18n.Tr "admin.auths.oauth2_profileURL"}}</label> + <input id="oauth2_profile_url" name="oauth2_profile_url" value="{{.oauth2_profile_url}}"> + </div> + <div class="oauth2_use_custom_url_field oauth2_email_url required field"> + <label for="oauth2_email_url">{{.i18n.Tr "admin.auths.oauth2_emailURL"}}</label> + <input id="oauth2_email_url" name="oauth2_email_url" value="{{.oauth2_email_url}}"> + </div> + {{if .OAuth2DefaultCustomURLMappings}} + {{range $key, $value := .OAuth2DefaultCustomURLMappings}} + <input id="{{$key}}_token_url" value="{{$value.TokenURL}}" type="hidden" /> + <input id="{{$key}}_auth_url" value="{{$value.AuthURL}}" type="hidden" /> + <input id="{{$key}}_profile_url" value="{{$value.ProfileURL}}" type="hidden" /> + <input id="{{$key}}_email_url" value="{{$value.EmailURL}}" type="hidden" /> + {{end}} + {{end}} +</div>
\ No newline at end of file |