The current setup of P4OAuth is fairly manual:
Download the latest version here:
p4oauth-VERSION.jar
filePut the binary in a "working folder"
Prepare a Java keystore file (see below for a self-signed mechanism)
Create a P4OAuth.yml
configuration file (see below)
Create a whitelist
configuration file (see below)
Launch P4OAuth: java -jar p4oauth.jar P4OAuth.yml
Here's an example of using the keytool
command that we currently use to prepare environments automatically:
keytool -genkeypair -dname "cn=Developer, ou=Engineering, o=Perforce, c=US" \
-alias business -keypass password -keystore keystore -storepass password \
-validity 180
It's run in the working directly, and sets up a simple keystore with the key
and store passwords set to password
.
For more information on keytool
please see the official documentation from Oracle.
Here's an example P4OAuth.yml file used for testing:
!com.perforce.workshop.tjuricek.p4oauth.config.P4OAuthConfig
keyStorePath: /Users/tjuricek/dev/workshop/p4oauth/functional_tests/build/keystore
keyStorePassword: password
keyManagerPassword: password
hostname: dhcp-141-n100.dhcp.perforce.com
rootDirectory: /Users/tjuricek/dev/workshop/p4oauth/functional_tests/build/p4oauth
perforce: !com.perforce.workshop.tjuricek.p4oauth.config.PerforceConfig
hostname: 127.0.0.1
port: 1666
Please note that this is mapped pretty directly to the Java class P4OAuthConfig
. Please refer to the javaDoc for more details.
Here's another example file used for testing:
servers:
- !com.perforce.workshop.tjuricek.p4oauth.models.WhitelistedServer
name: test_server
redirectUri: https://dhcp-141-n100.dhcp.perforce.com:8444/handle
ipAddress: 127.0.0.1
Please note this is also mapped to a single Java class Whitelist
. Please refer to the javadoc for more details.