Question

Summary
I am writing an application which uses Scribe to connect to an OAuth Server. I need to be able to change the endpoints in run-time (without recompiling). Is this possible?

More details
A java server application is using scribe to connect to an OAuth server. The OAuth-server is developed in-house, so I am extending DefaultApi10a to define the endpoints.

There are multiple instances of the OAuth-server, and I need to be able to configure my server application (in run-time) which one to connect to. But it seems that the endpoints are intended to be hardcoded in my sub-class of DefaultApi10a. Is there a good way around this?

Was it helpful?

Solution

There could be multiple way but I know these two ways.

  1. Fetch URL from database at run time and hit according to that
  2. Put URL in a config file and add a property file change listener in your java program.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top