-
Couldn't load subscription status.
- Fork 156
Client Applications
Navya Canumalla edited this page Nov 22, 2019
·
11 revisions
Before instantiating your app with MSAL4J,
- Understand the types of Client applications available- Public Client and Confidential Client applications.
- You'll need to register the application with Azure AD. You will therefore know:
- Its
clientID(a string representing a GUID) - The identity provider URL (named the instance) and the sign-in audience for your application. These two parameters are collectively known as the authority.
- Possibly the
TenantIDin the case you are writing a line of business application (just for your organization, also named single-tenant application) - In case it's a confidential client app, its application secret (
clientSecretstring) or certificate - For web apps, you'll have also set the
redirectUriwhere the identity provider will contact back your application with the security tokens.
- Its
PublicClientApplication app = PublicClientApplication.builder(TestData.PUBLIC_CLIENT_ID)
.authority(TestData.AUTHORITY_COMMON)
.build();
ConfidentialClientApplication app = ConfidentialClientApplication.builder(
TestData.CONFIDENTIAL_CLIENT_ID,
ClientCredentialFactory.create(TestData.CONFIDENTIAL_CLIENT_SECRET))
.authority(TestData.TENANT_SPECIFIC_AUTHORITY)
.build();
- Home
- Why use MSAL4J
- Register your app with AAD
- Scenarios
- Client Applications
- Acquiring tokens
- IAuthenticationResult
- Calling a protected API