Set an Alternative HTTPS Port

By default, the OAuth Toolkit policies are configured to use Port 8443 for HTTPS communication. This includes logging in to the OAuth Manager.
otk41
By default, the OAuth Toolkit policies are configured to use Port 8443 for HTTPS communication. This includes logging in to the OAuth Manager.
Customize the OTK to use an alternative port by configuring both policies and APIs:
Configuring Policies
The following policies contain references to Port 8443:
Custom configuration is made in the corresponding #policies.
In each case for the policies you:
  1. Copy the default Set Context Variable assertions containing the 8443 port from the read-only policy.
  2. Paste the default assertions into the corresponding editable #policy.
  3. Edit the port number.
  4. Save the #policy.
OTK Client Context Variables
This policy contains three references to the default 8443 port.
To set an alternate port number:
  1. In Policy Manager, open the read-only
    OTK Client Context Variables
    policy. This policy contains context variables set to the default 8443 port. 
  2. Select and copy the following Set Context Variable assertions in the read-only policy. Use Ctrl-click to select multiple assertions.
    • host_oauth2_auth_server
    • host_oauth_manager
    • host_oauth_test_clients
  3. Open the
    #OTK Client Context Variables
    policy found in the Customizations/Tools folder. By default, no context variables are set.
  4. Paste the copied assertions into the
    #OTK Client Context Variables
    policy.
  5. Double-click each assertion, edit the port number, and click
    OK
    .
  6. Save and Activate
    the #OTK Client Context Variables policy.
otk9443ClientContextVariables.png
OAuth Manager Config
This policy contains one reference to the default 8443 port.
To set an alternate port number:
  1. In Policy Manager, open the read-only
    oauth manager config
    policy.
  2. Copy the Set Context Variable assertion for this.app.url:
    Set Context Variable this.app.url as String to: https://${request.url.host}:8443${request.url.path}
  3. Open the
    #oauth manager config
    policy found in the Customizations/oauth manager folder. By default, no context variables are set.
  4. Paste the copied assertion into the
    #oauth manager config
    policy.
  5. Double-click the assertion, edit the port number, and click
    OK
    .
  6. Save and Activate the #oauth manager config policy.
9443oauthManConf.png
OTK Authorization Server Configuration
This policy contains two references to the default 8443 port.
To set an alternate port number:
  1. In Policy Manager, open the read-only
    OTK Authorization Server Configuration
    policy.
  2. Copy the following Set Context Variable assertions:
    • host_login_server
    • host_content_server
  3. Open the
    #OTK Authorization Server Configuration
    policy found in the Customizations/Authorization Server folder. By default, no context variables are set.
  4. Paste the copied assertions into the
    #OTK Authorization Server Configuration
    policy.
  5. Double-click the assertion, edit the port number, and click
    OK
    .
  6. Save and Activate the #OTK Authorization Server Configuration policy.
9443otkAuthServCnf.png
OTK Variable Configuration
This policy contains two references to the default 8443 port.
To set an alternate port number:
  1. In Policy Manager, open the read-only
    OTK Variable Configuration
    policy. Expand the assertions.
  2. Copy the following Set Context Variable assertions:
    • host_oauth2_auth_server
    • oauth2_server_port
  3. Open the
    #OTK Variable Configuration
    policy found in the Customizations/Tools folder. This #policy may already contain custom settings for your oauth2 server hostname and certificate.
  4. Paste the copied assertions into the
    #OTK Variable Configuration
    policy.
  5. Double-click the assertions, edit the port number, and click
    OK
    .
  6. Save and Activate the #OTK Variable Configuration policy.
9443otkVarConf.png
Configuring APIs
The APIs referencing the default 8443 can be configured directly.
The following APIs both reference the default 8443 port for the
this.app.url.login
context variable:
  • /oauth/manager/tokens
  • /oauth/manager/clients
You perform the same procedure in both APIs.
To configure the API with an alternative port:
  1. In Policy Manager, open the API.
  2. Search for "8443" and locate the assertion that sets the
    this.app.url.login
    context variable.
  3. Double click the assertion, edit the port number, and click
    OK
    .
    9443thisappurl.png
  4. Save and Activate
    the API.