Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Infakt API autoryzacja bez hasła i loginu
baltrek
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 3.04.2014

Ostrzeżenie: (0%)
-----


Witam.
Chciałem uzykać odpowiedz czy jest możliwe połączenie sie z infaktem bez podawania hasła i loginu a korzystania tylko i wyłącznie z KEY i SECRET. Chce skorzystać z kodu Jana Kondratowicza, musze skorzystać wiec z funkcji która oczekuje ode mnie hasła i loginu. czy jest mozliwość zeby to ominąć i uzyskać TOKEN?
  1. public function authorize($username, $password) {
  2. $parameters = array();
  3. $parameters['x_auth_username'] = $username;
  4. $parameters['x_auth_password'] = $password;
  5. $parameters['x_auth_mode'] = 'client_auth';
  6.  
  7. $oauth_request = OAuth\Request::from_consumer_and_token($this->consumer, null, 'GET', $this->requestTokenUrl);
  8. $oauth_request->sign_request($this->signatureMethod, $this->consumer, null);
  9. $response = $this->http($oauth_request->to_url(), 'GET');
  10. parse_str($response, $response);
  11.  
  12. $this->token = new OAuth\Token($response['oauth_token'], $response['oauth_token_secret']);
  13. $oauth_request = OAuth\Request::from_consumer_and_token($this->consumer, $this->token, 'POST', $this->accessTokenUrl, $parameters);
  14. $oauth_request->sign_request($this->signatureMethod, $this->consumer, $this->token);
  15.  
  16. $response = $this->http($oauth_request->to_url(), 'GET');
  17. parse_str($response, $token_array);
  18.  
  19. $this->token = new OAuth\Consumer($token_array['oauth_token'], $token_array['oauth_token_secret']);
  20.  
  21. return true;
  22. }
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 18:27