Access the Sample Application

By default when you create an Oracle WebLogic Server for OCI domain, sample applications are deployed automatically.

How to Access the Application

To access the sample-app application in a browser, enter a URL that's similar to the following:

https://IP_address:port/sample-app

The IP address and port you'll use depends on whether your domain is in a public or private subnet, and whether a load balancer is configured. See:

If your domain is configured to use Oracle Identity Cloud Service, then a second application is deployed named idcs-sample-app. See Access the Sample Application Using Identity Cloud Service.

What the Application Does

From the sample-app application, you can find documentation, tutorials, and other resources for Oracle WebLogic Server for OCI in the Oracle Help Center.

Use the idcs-sample-app application to test the integration with Oracle Identity Cloud Service. After signing in, the application displays information about the current user.

How to Manage the Application

You can verify that the sample applications are deployed and running by viewing the Deployments table in the WebLogic Server Administration Console. From the Deployments table, you can stop, start, and undeploy the applications.

Access the Sample Application Through a Public Load Balancer

If your Oracle WebLogic Server for OCI domain is associated with a public load balancer, use the public IP address of the load balancer to access the sample application.

This procedure applies to a domain created in a public or private subnet.
  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the navigation menu, click Networking, and then click Load Balancers.
  3. Select the Compartment in which the network resources for your domain were created.
    Depending on how the stack is initially created, this is the compartment that contains the compute instances and network resources for the domain, or this is the network compartment that has only the network resources for the domain.
  4. Click the name of the load balancer instance that's associated with your domain instance.
    The load balancer instance has -lb appended to the domain name. For example: abcde1xy-lb
  5. Copy the public IP address value.
  6. In a browser, specify the URL of the sample application. By default, the load balancer listens for HTTPS requests on port 443.
    https://IP-address/sample-app/

Access the Sample Application Through a Private Load Balancer

If your Oracle WebLogic Server for OCI domain is in a private subnet and is associated with a private load balancer, it is not accessible from the public Internet.

To access the sample application, you can use the bastion instance that's created on a public subnet and dynamic port forwarding with a secure shell (SSH) utility.

By opening an SSH tunnel with dynamic port forwarding, the SSH client becomes a Socket Secure (SOCKS) proxy listening on the port you specify. All traffic that routes to the proxy port is forwarded to its destination through the proxy server. Then when you configure your browser to use a SOCKS proxy, you can access the load balancer's private IP address.

Alternatively, you can configure a virtual private network (VPN) between your VCN and your on-premise data center. See VPN Connect in the Oracle Cloud Infrastructure documentation.

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the navigation menu, click Networking, and then click Load Balancers.
  3. Select the Compartment in which the network resources for your domain were created.
    Depending on how the stack is initially created, this is the compartment that contains the compute instances and network resources for the domain, or this is the network compartment that has only the network resources for the domain.
  4. Click the name of the load balancer instance that's associated with your domain instance.
    The load balancer instance has -lb appended to the domain name. For example: abcde1xy-lb
  5. Copy the IP address value.
  6. From the navigation menu, click Compute, and then click Instances.
  7. Select the Compartment in which the compute instances for your domain were created.
  8. Click the name of the bastion instance that's associated with the domain.
    The domain's bastion instance is identified by servicename-bastion-instance. For example: abcde1xy-bastion-instance
  9. Copy the public IP address value.
  10. From your computer, open an SSH tunnel to an unused port on the bastion node as the opc user. For SOCKS proxy, you can use port 1088.

    Specify the -D option to use dynamic port forwarding. Provide the path to the private key that corresponds to the public key that you specified when you created the domain.

    The SSH command format is:

    ssh -C -D port_for_socks_proxy -i path_to_private_key opc@bastion_public_ip

    For example:

    ssh -C -D 1088 -i ~/.ssh/mykey.openssh opc@198.51.100.1

    On a Windows platform, you can use Windows PowerShell to run the SSH command.

  11. In your browser settings, set up the SOCKS (version 5) proxy configuration. Specify your local computer and the same SOCKS port that you used in your SSH command.
  12. Specify the URL of the sample application in the following format, using the private IP address of the load balancer:
    https://private_ip_address/sample-app

    By default, the load balancer listens for HTTPS requests on port 443.

    For example:

    https://192.0.2.254/sample-app

Access the Sample Application Without a Load Balancer

If your Oracle WebLogic Server for OCI domain is not associated with a load balancer, use the IP address of a Managed Server node to access the sample application.

Note:

This procedure does not apply to a domain created in a private subnet. See Access the Sample Application in a Private Subnet.
  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Click the navigation menu Navigation Menu icon, select Compute. Under the Compute group, click Instances.
  3. From the Compartment dropdown, select the compartment in which your domain is created.
  4. Click the name of the compute instance that has the Administration Server and the first Managed Server.
    The instance has wls-0 appended to the name. For example: abcde7xy-wls-0
  5. Copy the public IP address value.
  6. In a browser, specify the URL of the sample application using the public IP address and the Managed Server port, in one of the following formats:
    https://IP-address:7004/sample-app/
    http://IP-address:7003/sample-app/

    Unless the ports were changed during stack creation, the default Managed Server ports are 7004 (SSL) and 7003.

    For example:

    https://198.51.100.1:7004/sample-app/
    http://198.51.100.1:7003/sample-app/

Access the Sample Application in a Private Subnet

Oracle WebLogic Server compute instances assigned to a private subnet are not accessible from the public Internet.

If your private domain is configured with a load balancer, see:

To access the sample application deployed to a private domain without a load balancer, you can use the bastion instance that's created on a public subnet and dynamic port forwarding with a secure shell (SSH) utility.

By opening an SSH tunnel with dynamic port forwarding, the SSH client becomes a Socket Secure (SOCKS) proxy listening on the port you specify. All traffic that routes to the proxy port is forwarded to its destination through the proxy server. Then when you configure your browser to use a SOCKS proxy, you can access the domain's private IP address.

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. Click the navigation menu Navigation Menu icon, select Compute. Under the Compute group, click Instances.
  3. From the Compartment dropdown, select the compartment in which your domain is created.
  4. Click the name of the compute instance that has the Administration Server and the first Managed Server.
    The instance has wls-0 appended to the name. For example: abcde7xy-wls-0
  5. Copy the private IP address value.
  6. Return to the Compute Instances page.
  7. Click the name of the bastion instance that's associated with the domain.
    The domain's bastion instance is identified by servicename-bastion-instance. For example: abcde7xy-bastion-instance
  8. Copy the public IP address value.
  9. From your computer, open an SSH tunnel to an unused port on the bastion node as the opc user. For SOCKS proxy, you can use port 1088.

    Specify the -D option to use dynamic port forwarding. Provide the path to the private key that corresponds to the public key that you specified when you created the domain.

    The SSH command format is:

    ssh -C -D port_for_socks_proxy -i path_to_private_key opc@bastion_public_ip

    For example:

    ssh -C -D 1088 -i ~/.ssh/mykey.openssh opc@198.51.100.1

    On a Windows platform, you can use Windows PowerShell to run the SSH command.

  10. In your browser settings, set up the SOCKS (version 5) proxy configuration. Specify your local computer and the same SOCKS port that you used in your SSH command.
  11. Specify the URL of the sample application in the following format, using the private IP address:
    http://private_ip_address:port/sample-app

    The default Managed Server port is 7003, unless it was changed during stack creation.

    For example:

    http://192.0.2.254:7003/sample-app

Access the Sample Application Using Identity Cloud Service

If your Oracle WebLogic Server for OCI domain is integrated with Oracle Identity Cloud Service, then a second sample application is automatically deployed so that you can test this integration.

The application is protected by Oracle Identity Cloud Service, so you must sign in as a valid user in Oracle Identity Cloud Service.

A domain that uses Oracle Identity Cloud Service for authentication always includes a load balancer. This procedure applies to a domain created in a public or private subnet.

Part of the application requires the user to be a member of a group named SampleAppAdmin. Create this group in Oracle Identity Cloud Service, and add at least one user to the group. See Create Groups in Oracle Cloud Infrastructure documentation.

  1. Sign in to the Oracle Cloud Infrastructure Console.
  2. From the navigation menu, click Networking, then click Load Balancers.
  3. Select the Compartment in which the network resources for your domain were created.
    Depending on how the stack is initially created, this is the compartment that contains the compute instances and network resources for the domain, or this is the network compartment that has only the network resources for the domain.
  4. Click the name of the load balancer instance that's associated with your domain instance.
    The load balancer instance has -lb appended to the domain name. For example: abcde1xy-lb
  5. Copy the public IP address value.
  6. Sign out from the Oracle Cloud Infrastructure Console.
  7. In a browser, specify the URL of the sample application. By default, the load balancer listens for HTTPS requests on port 443.
    https://IP-address/__protected/idcs-sample-app

    The URL includes two underscore characters.

    For example:

    https://192.0.2.254/__protected/idcs-sample-app
  8. Sign in to the Oracle Identity Cloud Service as a user who is a member of the SampleAppAdmin group.
  9. Click Protected page.

To protect other applications in the domain, see Secure a Domain Using Identity Cloud Service.