How to integrate Azure AD B2C into a java app using Open ID Connect?

Katrina Smith 20 Reputation points
2024-04-03T14:15:05.1633333+00:00

I'm new to Azure B2C and I'm integrating Azure AD B2C into a spring boot application. The app is a Web app that functions as a resource server and web application in one. The tenant is already created and the app is already registered. I'd like to use Open ID Connect with the application, but there seems to be some confusion over whether I need to set up a new Open ID Connect Provider for Azure B2C. Can someone tell me if I need to create a new Identity Provider for Azure B2C in order to use Open ID Connect? Or does the local account identity provider already serve that function?

Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
109 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,562 questions
0 comments No comments
{count} votes

Accepted answer
  1. Babafemi Bulugbe 1,870 Reputation points MVP
    2024-04-03T14:57:43.75+00:00

    Hello Katrina Smith,

    Thank you for posting this in the Microsoft Q&A Community.

    From my understanding, you would like to know if the local account identity in Azure AD B2C provides the capabilities of OpenID.

    Please be informed that the local account identity provider in Azure AD B2C is primarily used for username/password-based authentication. It allows users to sign up and sign in using their local credentials (email and password). It provides identity as a service to your application as it uses Open ID Connect for authentication. Follow this link to get more information https://learn.microsoft.com/en-us/azure/active-directory-b2c/protocols-overview

    User's image

    You can also configure a custom OIDC identity provider. Follow this link to see the step-by-step guide on how to set up a generic OpenID Connect provider. https://learn.microsoft.com/en-us/power-pages/security/authentication/azure-ad-b2c-provider

    Let me know if further assistance is needed.

    Babafemi


1 additional answer

Sort by: Most helpful
  1. Shweta Mathur 27,711 Reputation points Microsoft Employee
    2024-04-04T06:15:28.06+00:00

    Hi @Katrina Smith ,

    Thanks for reaching out.

    As Babafemi Bulugbe mentioned local account identity provider uses Open ID Connect for authentication. You won't require to add addition IDP in your existing application if you want your users to authenticate using username/password.

    You can refer below document which provide all the steps to integrate spring application with Azure AD B2C.

    Reference - https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory-b2c-oidc

    https://github.com/Azure-Samples/ms-identity-java-webapp/blob/master/msal-b2c-web-sample/README.md

    Hope this will help.

    Thanks,

    Shweta

    Please remember to "Accept Answer" if answer helped you.