I'm trying to get access to the server via its API. There is a possibility of access without opening the browser, as in provided example
curl "token url" -d "grant_type=password&client_id=&client_secret=&username=&password="
So I'm trying to use Google's API, specifically PasswordTokenRequest, basically copying the code from the javadoc
I downloaded the 1.20.0 library through maven and every method and class was imported, but setRedirectUri() was not. IntelliJ IDEA keeps telling me that it can't resolve this method, though it was used in official documentation. So the example provided in javadoc is wrong? If so, what is the correct way to get access to API if it requires Bearer token and the POST body looks like this?
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer 859ea2450228a5d655e3a8c2f9a5aedc30b591df" --header "Accept-Language: en" -d "{
\"jsonrpc\": \"2.0\",
\"method\": \"getByID\",
\"params\": {
\"Id\": 1
},
\"id\": 1
}" "rpc url"