Hej mam problem z autoryzacją przez API osram. Wprowadzam wszystkie dane client ID redirect url, Ale nie mogę dostać tego "code" który jest mi póżniej potrzebny do otrzymania tokena. Moje pytanie jak mam uzyskąć ten "code".
Mam:
Clinet_id d9b0d648-ab87-4514-af7a-610ed3b0687a
redirect_uri http://onet.pl/
Wrzucam coś takiego:
https://na.lightify-api.com/oauth2/authorize?client_id=d9b0d648-ab87-4514-af7a-610ed3b0687a&state={{state}}&redirect_uri=http://onet.pl/&response_type=code
Na ich stronie piszą.
GET Authorize user & obtain a code
https://na.lightify-api.com/oauth2/authorize?client_id=cb515518-1b27-45da-9821-b86b1c4264b&state={{state}}&redirect_uri=http://your.server.com/&response_type=code
As an application developer you need to use a browser or webView to send the end user to this URL.
The client_id is obtained via the developer interface.
The value of the parameter state should be randomized to keep track of the end user authorizing and allow the correct association of codes and tokens. This collection uses a parameter value of STATE-xxxxx where xxxxx is a number. The random number is generated in the pre-request script.
The redirect uri must match one of the redirect uris entered when creating a client in the developer portal otherwise the call will fail.
If the application is going to scrape the code, the redirect_uri should be a trusted website and the code is obtained from the redirection call.
PARAMS client_id cb515518-1b27-45da-9821-b86b1c4264b state{{state}} redirect_uri http://your.server.com/ response_typecode"