Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Secure JBoss EAP apps with Microsoft Entra ID & OpenID Connect

April 1, 2024
Philip Hayes
Related topics:
JavaSecurity
Related products:
Red Hat JBoss Enterprise Application Platform

    The recent release of Red Hat JBoss EAP 8.0 includes native support for OpenID Connect (OIDC) via the elytron-oidc-client subsystem. OIDC is an identity layer that enables clients, such as JBoss EAP, to verify a user’s identity based on authentication performed by an OpenID provider. For example, you can secure your JBoss EAP applications using the Red Hat build of Keycloak as the OpenID provider.

    In this article, we will use the elytron-oidc-subsystem to secure a simple web application using Microsoft Entra ID (formerly Azure Active Directory) as the OpenID provider.

    For more information about JBoss EAP 8.0's native OpenID Connect support, refer to the product documentation.

    Prerequisites

    • A local installation of JBoss EAP 8.0. Download the installation manager from Red Hat Developer.
    • JBOSS_HOME environment variable set as the installation folder for JBoss EAP 8.0.
    • A Microsoft Azure account with an active subscription.

    Connect a web application to Microsoft Entra ID

    1. Check out the sample application here.

    2. Create a file src/main/webapp/WEB-INF/oidc.json with the following contents:

      {
          "client-id" : "<<from azure>",
          "provider-url" : "<<from azure>",
          "ssl-required" : "EXTERNAL",
          "credentials" : {
              "secret" : "<<from azure>>"
           }
      }
    3. In the Azure portal, go to the All Services page and click Microsoft Entra ID.

    4. In the left-hand menu, select App registrations and click New Registration. You will see the Register an application page shown in Figure 1.

      Register a new application
      Figure 1: Register a new application
      Figure 1: Register a new application.
    5. Enter a name (e.g., jboss) and click the Register button. This brings you to the App registrations overview page for your application.

    6. Click Add a Redirect URL, then click Add a Platform.

    7. Select Web; you will see the Configure Web page, as shown in Figure 2.

      Configure a web application
      Figure 2: Configure a web application
      Figure 2: Configure a web application.
    8. Enter the following URL:

      http://localhost:8080/simple-webapp-oidc/secured
    9. Click the Configure button.

    10. Go back to the Overview page and click Add a certificate or secret.

    11. Select + New Client secret. This brings you to the Add a client secret page (Figure 3).

      Create a new secret
      Figure 3: Create a new secret
      Figure 3: Create a new secret.
    12. Enter a description (e.g., EAP) and click the Add button.

    13. Copy the value shown on the next page and paste this value into src/main/webapp/WEB-INF/oidc.json as the secret value.

    14. Return to the Overview page and click on Endpoints.

    15. Copy the value from OpenID Connect metadata document and paste it into src/main/webapp/WEB-INF/oidc.json as the provider-url. Be sure to remove the text /.well-known/openid-configuration.

    16. Return to the Overview page. Copy the Application (client) ID and paste this value in src/main/webapp/WEB-INF/oidc.json as the client-id.

    17. Save the changes to the oidc.json file.

    Our connection to Microsoft Entra ID is now configured, and we can deploy our application to JBoss EAP 8.0 and test the authentication.

    Test the Azure authentication

    1. First, we're going to start our JBoss EAP 8.0 instance. Run the following command to start JBoss EAP 8.0:

      $JBOSS_HOME/bin/standalone.sh 
    2. We can now deploy our app. From the folder containing the sample application source code, enter:

      mvn wildfly:deploy 
    3. We can access our application using http://localhost:8080/simple-webapp-oidc/.

      Click Access Secured Servlet. Now you'll be redirected to the Azure login page (Figure 4). Log in with your Azure credentials.

      Azure login page
      Figure 4: Azure login page
      Figure 4: Azure login page.
    4. Next, you'll be redirected back to our application and you should see the Secured Servlet page:

      Secured Servlet
      Current Principal 'xxxx'

    We were able to successfully log in to our application via the Microsoft Entra ID provider!

    Summary

    With JBoss EAP 8.0, OpenID Connect support is provided by the included elytron-oidc-subsytem. In this article, we demonstrated how to secure a simple JBoss EAP 8.0 web application with Azure authentication via Open ID Connect.

    For further information on JBoss EAP 8.0 OpenID support, refer to the documentation.

    Related Posts

    • How JBoss EAP 8.0 makes deployment on OpenShift easier

    • How to deploy JBoss EAP on an Azure virtual machine

    • How to use JBoss EAP 8.0's new provisioning system

    • How to easily deploy JBoss EAP on Azure

    • How to migrate apps from JBoss EAP 7.x to JBoss EAP 8.0

    • How to easily deploy JBoss EAP on Azure

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

    Want to do more with Java? Explore this free learning path, where you'll learn how to deploy applications to middleware with the IntelliJ IDE extension.

    Start the learning path
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI