FIX: Looks like `token_params` weren't being attached properly
This commit is contained in:
parent
1961285970
commit
27ff369904
|
@ -20,14 +20,10 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
|
||||||
authorize_url: SiteSetting.oauth2_authorize_url,
|
authorize_url: SiteSetting.oauth2_authorize_url,
|
||||||
token_url: SiteSetting.oauth2_token_url
|
token_url: SiteSetting.oauth2_token_url
|
||||||
}
|
}
|
||||||
|
opts[:token_params] = {headers: {'Authorization' => basic_auth_header }}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_access_token
|
|
||||||
options.token_params.merge!(:headers => {'Authorization' => basic_auth_header })
|
|
||||||
super
|
|
||||||
end
|
|
||||||
|
|
||||||
def basic_auth_header
|
def basic_auth_header
|
||||||
"Basic " + Base64.strict_encode64("#{SiteSetting.oauth2_client_id}:#{SiteSetting.oauth2_client_secret}")
|
"Basic " + Base64.strict_encode64("#{SiteSetting.oauth2_client_id}:#{SiteSetting.oauth2_client_secret}")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue