All configurations, both client and server work the same. This article documents their commonalities. Features are:
Comment: ALL tag names are case sensitive in the configuration file -- as per the XML spec, so "fileStore" works, but "filestore" would not, for instance.
There are two things that determine which configuration to use, the file in which it resides and the name of the configuration in that file. These will henceforth be referred to as the file parameter and name parameter. To specify parameters you have two options:
Tip: It is a very good idea to put your context parameters in the server web.xml (should be
located at $CATALINA_HOME/conf/web.xml
.) This will allow you to swap out/upgrade versions of
OA4MP without having to touch any configuration -- just drop a new version of the war into the right
place and restart the server to get an upgrade.
Clients and servers as well as different versions of OA4MP have different parameters. The specific of those will be documented elsewhere. However, here is the definitive list for reference
Component | Parameter | OAuth 1.0a | OAuth 2.0 |
---|---|---|---|
client | file | oa4mp:client.config.file | oa4mp:oauth2.client.config.file |
name | oa4mp:client.config.name | oa4mp:oauth2.client.config.name | |
server | file | oa4mp:server.config.file | oa4mp:oauth2.server.config.file |
name | oa4mp:server.config.name | oa4mp:oauth2.server.config.name |
<context-param> <param-name>oa4mp:server.config.file</param-name> <param-value>/path/to/cfg.xml</param-value> </context-param> <context-param> <param-name>oa4mp:server.config.name</param-name> <param-value>default</param-value> </context-param>
in this case the server configuration file at /path/to/cfg.xml would be loaded, searched and the configuration named "default" would be loaded. For a given version and component, use the appropriate parameter from the table above.
<config> <client name="default" alias="postgres-cfg"/> <client name="postgres-cfg"> <!-- lots of stuff --> </client> <client name="debug-cfg"> <!-- lots of other stuff --> </client> </config>
<config> <file include="/path/to/file.xml"/> <client name="default" alias="postgres-cfg"/> </config>and the next file, which is
/path/to/file.xml
in toto is
<config> <client name="postgres-cfg"> <!-- lots of stuff --> </client> <client name="debug-cfg"> <!-- lots of other stuff --> </client> </config>Refer to the first file in your deployment. The second will be loaded for you automatically.