Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> 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
Pyton_000
post
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


A czytałeś dokumentacje?
http://www.infakt.pl/api_infakt#autoryzacja
Go to the top of the page
+Quote Post
baltrek
post
Post #3





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

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


Pewnie ze czytałem. Autoryzacja przebiega przy pomocy oauth'a który teoretycznie wymaga hasła ale gdy wchodzę do swojego konta to muszę przechodzić przez powyższy kod czy mogę go jjakoś pominąć
Go to the top of the page
+Quote Post
Pyton_000
post
Post #4





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

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


Tak poza tym, to ja nie widzę w Twoim kodzie aby gdziekolwiek było używane hasło i login które "podajesz" No chyba że ślepy jestem (IMG:style_emoticons/default/oneeyedsmiley02.png)
Go to the top of the page
+Quote Post

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: 14.09.2025 - 23:59