Oracle by Example brandingSecuring an Oracle Java Cloud Service Application with Oracle Identity Cloud Service

section 0Before You Begin

This 15-minute tutorial shows you how to secure your Oracle Java Cloud Service instance and WebLogic Server domain that use Oracle Identity Cloud Service for authentication.

Background

Java applications that are deployed to a Java Cloud Service instance can be configured to use Identity Cloud Service for authentication. Only users that exist in Identity Cloud Service are granted access to these applications. By default, applications that you want to protect with Identity Cloud Service must be configured with a context root that starts with the text "__protected".

What Do You Need?


section 1Secure Your Oracle Java Cloud Service Application

  1. Sign in to Oracle Cloud as a user with the Java Administrator role that created your JCS instance (MyJCS).
  2. From the Oracle Cloud Infrastructure Console, click the Navigation menu Dashboard Menu Icon at the top left corner of the page, expand Platform Services, and then select Java.

    Note: On some older Oracle Cloud accounts, you use the Oracle Cloud Infrastructure Classic Console. Click the Navigation menu Dashboard Menu Icon, and then select Java.

  3. Click the name of your service instance. This tutorial uses the name MyJCS. The details page displays.
  4. In the Instance Overview section, copy the Sample Application URL.
  5. Start a different browser session, and navigate to the Sample Application link that you copied. No login is required.
  6. Return to the Details page in the Java Cloud Service Console.
  7. Click Manage this Service Manage this Service Menu Icon at the top of the page, and then select Open WebLogic Service Console.
  8. Log into the WebLogic console as the Java Administrator or WebLogic Administrator.
  9. In the Change Center box at the top left corner of the page, click Lock & Edit.
  10. In the Domain Structure box, click Deployments. The Summary of Deployments page displays.
  11. In the Configuration tab, click Customize this table.
  12. In the View section, select the checkbox Exclude libraries when displaying deployments, and then click Apply.
  13. In the Name column of the Deployments table, click sample-app.
    The sample-app link
    Description of the illustration sample_app.png
  14. Click the Configuration tab.
  15. In the General subtab, enter /__protected/sample-app for the Context Root: option. Note that the value should contain two underscores after the first forward slash character.
    The sample-app link
    Description of the illustration context_root.png
  16. Click Save. The Save Deployment Plan Assistant displays.
  17. Click OK. A message stating that a new deployment plan has been successfully created displays with the directory path of the Plan.xml file.
  18. In the Change Center box at the top left corner of the page, click Activate Changes.
  19. Logout of the WebLogic console.

section 2Test the Secured Oracle Java Cloud Service Application

  1. Return to the Java Cloud Service Console.
  2. In the Instance Overview section of the MyJCS details page, copy the Sample Application URL.
  3. Start a different browser session (where you are not already logged in), add /__protected before /sample-app in the Sample Application link that you copied, and navigate to this updated URL.
  4. Log into the sample-app as any Oracle Cloud user; for example, your Java Administrator or WebLogic Administrator users.

next stepNext Tutorial

Use Groups and Roles to Protect an Oracle Java Cloud Service Application


more informationWant to Learn More?