Add support for scope and add some missing translations
See this post on meta about the need for the ability to request a custom scope: https://meta.discourse.org/t/oauth2-basic-support/33879/116?u=blake
This commit is contained in:
parent
f60a5799a1
commit
04ef6494de
|
@ -12,8 +12,11 @@ en:
|
||||||
oauth2_json_username_path: 'Path in the OAuth2 User JSON to the username. eg: user.username'
|
oauth2_json_username_path: 'Path in the OAuth2 User JSON to the username. eg: user.username'
|
||||||
oauth2_json_name_path: "Path in the OAuth2 User JSON to the user's full: user.name.full"
|
oauth2_json_name_path: "Path in the OAuth2 User JSON to the user's full: user.name.full"
|
||||||
oauth2_json_email_path: "Path in the OAuth2 User JSON to the user's email: user.email.primary"
|
oauth2_json_email_path: "Path in the OAuth2 User JSON to the user's email: user.email.primary"
|
||||||
|
oauth2_json_avatar_path: "Path in the Oauth2 User JSON to the user's avatar: user.avatar_url"
|
||||||
oauth2_email_verified: "Check this if the OAuth2 site has verified the email"
|
oauth2_email_verified: "Check this if the OAuth2 site has verified the email"
|
||||||
oauth2_send_auth_header: "Send the token as an HTTP Authorization header"
|
oauth2_send_auth_header: "Send the token as an HTTP Authorization header"
|
||||||
oauth2_debug_auth: "Include rich debugging information in your logs"
|
oauth2_debug_auth: "Include rich debugging information in your logs"
|
||||||
oauth2_authorize_options: "When authorizing request these options"
|
oauth2_authorize_options: "When authorizing request these options"
|
||||||
|
oauth2_scope: "When authorizing request this scope"
|
||||||
|
oauth2_button_title: "The text for the OAuth2 button"
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ login:
|
||||||
oauth2_authorize_options:
|
oauth2_authorize_options:
|
||||||
default: 'scope'
|
default: 'scope'
|
||||||
type: list
|
type: list
|
||||||
|
oauth2_scope: ''
|
||||||
oauth2_button_title:
|
oauth2_button_title:
|
||||||
default: 'with OAuth2'
|
default: 'with OAuth2'
|
||||||
client: true
|
client: true
|
||||||
|
|
|
@ -40,6 +40,9 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
|
||||||
if SiteSetting.oauth2_send_auth_header?
|
if SiteSetting.oauth2_send_auth_header?
|
||||||
opts[:token_params] = { headers: { 'Authorization' => basic_auth_header } }
|
opts[:token_params] = { headers: { 'Authorization' => basic_auth_header } }
|
||||||
end
|
end
|
||||||
|
unless SiteSetting.oauth2_scope.blank?
|
||||||
|
opts[:scope] = SiteSetting.oauth2_scope
|
||||||
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue