Пример #1
0
        public void SetupOAuthClient(WebApiClient client, IOAuthAccessToken token)
        {
            var session    = EntityHelper.GetSession(token);
            var tokenValue = token.AccessToken;

            client.AddAuthorizationHeader(tokenValue, scheme: token.TokenType.ToString());
        }
Пример #2
0
        //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");
        }