问题
I am new to Azure AD B2C. I am trying to use Azure AD B2C for authentication with a Java web application, but there does not seem to be any guides or Java code samples to help.
Can anyone help with some basic code samples that could help explain how to integrate with a Java client?
回答1:
There isn't currently a Java Azure AD B2C web app sample. I have written a Azure AD v2.0 Java Web App Sample. This app is a bit different than Azure AD B2C, but the code will be extremely similar.
I recommend checking out the Azure AD B2C developer guide for help configuring a tenant & app, then use the sample code above and change the configurations for that of Azure AD B2C. After getting a basic understanding, you can use discovery endpoint to identify the specific configs your web app will need.
You can find the Azure AD B2C endpoints using the discovery url:
https://login.microsoftonline.com/tfp/fabrikamb2c.onmicrosoft.com/b2c_1_sign_in/v2.0/.well-known/openid-configuration
Where fabrikamb2c.onmicrosoft.com is the name of your tenant and b2c_1_sign_in is your Azure AD B2C policy.
For more info on what this means, I recommend reading the Azure AD B2C Protocol & Token Reference.
来源:https://stackoverflow.com/questions/44695095/need-support-for-azure-ad-b2c-webapp-integration