Sample Java OAuth client to use REST API through Java SDK

Hello there,

Anyone using REST API through Java SDK? Please share sample Java OAuth client to use REST API through Java SDK.

Is there any way to automate the Authorization process?
We have followed three steps described in OAuth2 Authentication - Keap Developer Portal

Request Permission through browser https://signin.infusionsoft.com/app/oauth/authorize?client_id={client_id}&redirect_uri=https://example.com&response_type=code&scope=full got one screen to Allow the API access, Hit the button to Allow the API access , now it is redirected to specified uri with required “code” information.

But the question is there any way to automate authorizing requests programmatically.

Any sample OAuth client or any pointers about this would be great help

Thank you.!

Good morning,

Google has a very complete OAuth2 Java library that you can use to set up an application to request tokens. However, all OAuth flows require user interaction to authenticate with the provider; you can not access their data until authorization is granted.

1 Like

Hi @TomScott

Thanks for the reply.
I have gone through this Making OAuth Requests Without User Authorization - Keap Developer Portal where it says once we get access_token we can refresh access_token with refresh_token with cronjob calling every day after 21hrs

Quick question to help with is the Authorization is once it is required or every time we make a request? while calling each end point

With integrations from other apps (such as woocommerce, clickfunnels etc.,) I hope the authorization is one time (otherwise, how the integrations are working?)

Please clarify.

Thank you very much

Yes, so long as you refresh the token while it is still active, you do not need to re-authorize.

Hi @TomScott

Thank you for the reply.
That clears.