public void SetupOAuthClient(WebApiClient client, IOAuthAccessToken token) { var session = EntityHelper.GetSession(token); var tokenValue = token.AccessToken; client.AddAuthorizationHeader(tokenValue, scheme: token.TokenType.ToString()); }
//Fitbit is the only one requiring this in auth header: https://dev.fitbit.com/docs/oauth2/#access-token-request private void AddClientInfoHeader(WebApiClient client, string clientId, string clientSecret) { var encClientInfo = StringHelper.Base64Encode(clientId + ":" + clientSecret); client.AddAuthorizationHeader(encClientInfo, "Basic"); }