简体   繁体   中英

Can a Scribe API be configurable in run-time?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM