Skip to content

Latest commit

 

History

History
63 lines (37 loc) · 3.36 KB

enable-java-weblogic-webapp-authorization-group-entra-id.md

File metadata and controls

63 lines (37 loc) · 3.36 KB
title titleSuffix description author ms.author ms.reviewer ms.date ms.topic ms.custom
Secure Java WebLogic apps using groups and group claims
Azure
Shows how to create a WebLogic app to sign in users and restrict access to pages using security groups and group claims with the Microsoft identity platform.
KarlErickson
karler
bbanerjee
03/11/2024
article
devx-track-identity-java, devx-track-java, devx-track-extended-java

Secure Java WebLogic apps using groups and group claims

This article shows you how to create a Java WebLogic app that signs in users with Microsoft Authentication Library (MSAL) for Java. The app also restricts access to pages based on Microsoft Entra ID security group membership.

[!INCLUDE scenario-authorization-groups.md]

Prerequisites

[!INCLUDE prerequisites-authorization-groups.md]

[!INCLUDE prerequisites-weblogic.md]

Recommendations

[!INCLUDE java-servlet-overview-recommendation.md]

[!INCLUDE enable-java-servlet-webapp-authorization-group-entra-id.md]

Deploy the sample

These instructions assume that you installed WebLogic and set up some server domain.

Before you can deploy to WebLogic, use the following steps to make some configuration changes in the sample itself and then build or rebuild the package:

  1. In the sample, find the application.properties or authentication.properties file where you configured the client ID, tenant, redirect URL, and so on.

  2. In this file, change references to localhost:8080 or localhost:8443 to the URL and port that WebLogic runs on, which by default should be localhost:7001.

  3. You also need to make the same change in the Azure app registration, where you set it in the Azure portal as the Redirect URI value on the Authentication tab.

Use the following steps to deploy the sample to WebLogic via the web console:

  1. Start the WebLogic server with DOMAIN_NAME\bin\startWebLogic.cmd.

  2. Navigate to the WebLogic web console in your browser at http://localhost:7001/console.

  3. Go to Domain Structure > Deployments, select Install, select Upload your files, and then find the .war file that you built using Maven.

  4. Select Install this deployment as an application, select Next, select Finish, and then select Save.

  5. Most of the default settings should be fine except that you should name the application to match the redirect URI you set in the sample configuration or Azure app registration. That is, if the redirect URI is http://localhost:7001/msal4j-servlet-auth, then you should name the application msal4j-servlet-auth.

  6. Go back to Domain Structure > Deployments, and start your application.

  7. After the application starts, navigate to http://localhost:7001/<application-name>/, and you should be able to access the application.

[!INCLUDE enable-java-servlet-webapp-authorization-group-entra-id-explore.md]

Next step

Deploy Java WebLogic apps to WebLogic on Azure Virtual Machines