Inheritance: IRequestInterceptor
コード例 #1
0
        public static void OAuth1SetAccessToken(this ISession session, OAuth1Token token, bool isAuthorized = false)
        {
            OAuth1RequestInterceptor interceptor = GetExistingInterceptor(session);

            interceptor.SetAccessToken(token);
            interceptor.IsAuthorized = isAuthorized;
        }
コード例 #2
0
ファイル: OAuth1Extensions.cs プロジェクト: JornWildt/Ramone
        public static ISession OAuth1Logger(this ISession session, IOAuth1Logger logger)
        {
            OAuth1RequestInterceptor interceptor = GetExistingInterceptor(session);

            interceptor.Logger = logger;

            return(session);
        }
コード例 #3
0
        private static OAuth1RequestInterceptor GetExistingInterceptor(ISession session)
        {
            OAuth1RequestInterceptor interceptor = session.RequestInterceptors.Find("OAuth") as OAuth1RequestInterceptor;

            if (interceptor == null)
            {
                throw new InvalidOperationException("Could not locate OAuth request interceptor. Did you call Session.OAuth1Configure()?");
            }
            return(interceptor);
        }
コード例 #4
0
        private static OAuth1Settings GetExistingSettings(ISession session)
        {
            OAuth1RequestInterceptor interceptor = GetExistingInterceptor(session);

            return(interceptor.Settings);
        }
コード例 #5
0
        public static bool OAuth1IsAuthorized(this ISession session)
        {
            OAuth1RequestInterceptor interceptor = GetExistingInterceptor(session);

            return(interceptor.IsAuthorized);
        }