FIX: Include the `Authorization` header for services that need it

This commit is contained in:
Robin Ward 2015-10-26 12:45:11 -04:00
parent 20a3bbe123
commit 7bc71b5378
1 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,15 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
} }
end end
def build_access_token
options.token_params.merge!(:headers => {'Authorization' => basic_auth_header })
super
end
def basic_auth_header
"Basic " + Base64.strict_encode64("#{SiteSetting.oauth2_client_id}:#{SiteSetting.oauth2_client_secret}")
end
def walk_path(fragment, segments) def walk_path(fragment, segments)
first_seg = segments[0] first_seg = segments[0]
return if first_seg.blank? || fragment.blank? return if first_seg.blank? || fragment.blank?