private void btnLogin_Click(object sender, EventArgs e)
        {
            string client_id = "CLIENT_ID";
            string client_secret = "CLIENT_SECRET";

            /* Tokenları Saklayıp her seferinde giriş yapmadan kullanabilirsiniz */

            if (tokensPresentInDb())
            {
                /* Eğer tokenlar saklandıysa */
                string access_token = getAccessTokenFromDb();
                string refresh_token = getRefreshTokenFromDb();

                Token tkn = new Token(access_token, refresh_token);
                BulutfonWinClient client = new BulutfonWinClient(client_id, client_secret);
                tkn.TokenExpired += client.tokenProviderTokenExpired;
                Authentication.Token = tkn;
                showCallPanel(true);
            }
            else
            {
                /* Baştan token al */
                var loggedIn = LoginForm.Login(client_id, client_secret, this);
                showCallPanel(loggedIn);
            }
        }
Example #2
0
 protected LoginForm(string clientId, string clientSecret)
 {
     InitializeComponent();
     client = new BulutfonWinClient(clientId, clientSecret);
 }
Example #3
0
 protected LoginForm(string clientId, string clientSecret) {
     InitializeComponent();
     client = new BulutfonWinClient(clientId, clientSecret);
 }