예제 #1
0
 public  Client(string APIKEY)
 {
     this.setToken(APIKEY);
     this._auth = new Auth(this);
     this._api = new Api(this);
     this.user = this.api.user;
 }
예제 #2
0
 /**
 * Get authorization code and setToken
 *  if process is done successfully, return true else return false
 * @return boolean
 */
 
 public bool get_token_from_request() {  
     string authcode = HttpContext.Current.Request.QueryString["code"];
     if (authcode != null)
     {
         auth_code = authcode;
         AuthorizationCode code = new AuthorizationCode();
         code.client_id = this.client_id;
         code.client_secret = this.client_secret;
         code.code = this.auth_code;
         code.grant_type = "authorization_code";
         code.redirect_uri = this.redirect_uri;
         auth_result = new AccessToken();
         this._auth = new Auth(this);
         auth_result = _auth.authenticate(code);
         this.setToken(auth_result);
         return true;
     }
     else
     {
         return false;
     }
 }
예제 #3
0
 public Client()
 {
     this._auth = new Auth(this);
     this._api = new Api(this);
     this.user = this.api.user;
 }