Пример #1
0
        /// <summary>
        /// Returns access token obtained after authenticating client app
        /// </summary>
        /// <param name="state">state query parameter</param>
        /// <returns>string representing access token if authentication succeded, null otherwise</returns>
        public static string AuthenticateFromWinProgram(ref string state){
            var authform = new AuthenticationForm {State = state};

            authform.ShowDialog();
            state = authform.State; 

            return authform.AccessToken;
        }
Пример #2
0
        /// <summary>
        /// Returns access token obtained after authenticating client app
        /// </summary>
        /// <param name="state">state query parameter</param>
        /// <returns>string representing access token if authentication succeded, null otherwise</returns>
        public static string AuthenticateFromWinProgram(ref string state)
        {
            var authform = new AuthenticationForm {
                State = state
            };

            authform.ShowDialog();
            state = authform.State;

            return(authform.AccessToken);
        }