configuration.html #2

  • //
  • guest/
  • tjuricek/
  • p4oauth/
  • docs/
  • site/
  • configuration.html
  • View
  • Commits
  • Open Download .zip Download (5 KB)
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>Configuration</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="keywords" content="">
    <meta name="generator" content"JBake">

    <!-- Le styles -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/asciidoctor.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <!--<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">-->
    <link rel="shortcut icon" href="favicon.ico">
  </head>
  <body>
    <div id="wrap">

<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <ul class="nav navbar-nav">
                <li><a href=".">p4oauth</a></li>
                <li><a href="overview.html">Overview</a></li>
                <li><a href="configuration.html">Configuration</a></li>
                <li><a href="api.html">API</a></li>
                <li><a href="development.html">Development</a></li>
                <li><a href="../javadoc">Javadoc</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container">

<h1>Configuring and Running P4OAuth</h1><p>The current setup of P4OAuth is fairly manual:</p>
<ol>
  <li><p>Download the latest version here: <a href='https://bintray.com/tristanjuricek/maven/p4oauth/_latestVersion'><img src='https://api.bintray.com/packages/tristanjuricek/maven/p4oauth/images/download.png'></a></p>
  <ul>
    <li>Open the files tab</li>
    <li>Download the <code>p4oauth-VERSION.jar</code> file</li>
  </ul></li>
  <li><p>Put the binary in a "working folder"</p></li>
  <li><p>Prepare a Java keystore file (see below for a self-signed mechanism)</p></li>
  <li><p>Create a <code>P4OAuth.yml</code> configuration file (see below)</p></li>
  <li><p>Create a <code>whitelist</code> configuration file (see below)</p></li>
  <li><p>Launch P4OAuth: <code>java -jar p4oauth.jar P4OAuth.yml</code></p></li>
</ol><h2>Create A self-signed Java keystore file</h2><p>Here's an example of using the <code>keytool</code> command that we currently use to prepare environments automatically:</p>
<pre><code>keytool -genkeypair -dname &quot;cn=Developer, ou=Engineering, o=Perforce, c=US&quot; \
    -alias business -keypass password -keystore keystore -storepass password \
    -validity 180
</code></pre><p>It's run in the working directly, and sets up a simple keystore with the key<br/>and store passwords set to <code>password</code>.</p><p>For more information on <code>keytool</code> please see the <a href="http://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html">official documentation from Oracle</a>.</p><h2>Create a P4OAuth.yml file</h2><p>Here's an example P4OAuth.yml file used for testing:</p>
<pre><code>!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
</code></pre><p>Please note that this is mapped pretty directly to the Java class <a href="../javadoc/com/perforce/workshop/tjuricek/p4oauth/config/P4OAuthConfig.html"><code>P4OAuthConfig</code></a>. Please refer to the javaDoc for more details.</p><h2>Create the whitelist configuration file</h2><p>Here's another example file used for testing:</p>
<pre><code>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
</code></pre><p>Please note this is also mapped to a single Java class <a href="../javadoc/com/perforce/workshop/tjuricek/p4oauth/models/Whitelist.html"><code>Whitelist</code></a>. Please refer to the javadoc for more details.</p>

</div>

    </div><!-- #wrap -->

    
    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>

  </body>
</html>
# Change User Description Committed
#2 9181 tjuricek Updating documentation
#1 9161 tjuricek 0.1.0 Minimal p4oauth server that provides a basic authorization code grant.