Can anyone please show me how to get a long live access token or how to use a refresh token in the java sdk. I need it to automatically happen as i am making automations.
Please
Hi @corvettemina,
Fully automatic authentication has never been and likely will never be. Particular user that gives right to your application to do something on his account, needs to confirm it somehow (such thing can't be fully automatic - or I don't know for such, at least). About "long live access token"; if you have some exist, you can still use it as... always. If you mean to get a new one, it's impossible already. Such tokens, even usable still, are considered obsolete and likely will be dropped at some future point. You can see "how to use a refresh token in the java sdk" in some of the examples there (here, for instance, to receive one and here for usage in action).
Hope this helps.
@corvettemina As Здравко said, the user needs to authorize the app, at least once. For long-term access, you should now be using refresh tokens. The Java SDK can actually handle the refresh process for you automatically, as long as you supply the necessary credentials, e.g., as shown retrieved in this example (meant for server-side Java apps), or this example (meant for client-side Java apps), and then used as shown in this example. (For Android, see this example instead.)
Awesome I've used these before maybe i am missing something after I authorized once who do i continue using it with out having to be prompted?
Thanks!
@corvettemina, if you have used the same before, do it in the same way and only difference should be different type of token (access token before, refresh token now). That's it. If your code prompts again (without actual need), seems you have changed something in your application (something that didn't need to be changed) or you have some logical error there. Debug your code. 😉 Your code initiates the authorization, Java SDK just performs it.
Hope this gives direction.