From 27ff369904f1389216e485b4da64b59b45fef671 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 11 Nov 2015 13:00:40 -0500 Subject: [PATCH] FIX: Looks like `token_params` weren't being attached properly --- plugin.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugin.rb b/plugin.rb index 25705a8..77c88fb 100644 --- a/plugin.rb +++ b/plugin.rb @@ -20,14 +20,10 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator authorize_url: SiteSetting.oauth2_authorize_url, token_url: SiteSetting.oauth2_token_url } + opts[:token_params] = {headers: {'Authorization' => basic_auth_header }} } 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