Class IntelliJCredential

java.lang.Object
com.azure.identity.IntelliJCredential
All Implemented Interfaces:
com.azure.core.credential.TokenCredential

public class IntelliJCredential extends Object implements com.azure.core.credential.TokenCredential

IntelliJ IDEA is an integrated development environment (IDE) developed by JetBrains, which provides a variety of features to support software development, such as code completion, debugging, and testing. Azure offers Azure Toolkit for IntelliJ plugin for the IntelliJ IDEA development environment. It enables developers to create, test, and deploy Java applications to the Azure cloud platform. In order to use the plugin authentication as a user or service principal against Microsoft Entra ID is required. The IntelliJCredential authenticates in a development environment and acquires a token on behalf of the logged-in account in Azure Toolkit for IntelliJ. It uses the logged in user information on the IntelliJ IDE and uses it to authenticate the application against Microsoft Entra ID.

Configure IntelliJCredential

Follow the steps outlined below:

  1. In your IntelliJ window, open File > Settings > Plugins.
  2. Search for "Azure Toolkit for IntelliJ" in the marketplace. Install and restart IDE.
  3. Find the new menu item Tools > Azure > Azure Sign In.
  4. Device Login will help you log in as a user account. Follow the instructions to log in on the login.microsoftonline.com website with the device code. IntelliJ will prompt you to select your subscriptions. Select the subscription with the resources that you want to access.

Once the developer has followed the steps above and authenticated successfully with Azure Tools for IntelliJ plugin in the IntelliJ IDE then this credential can be used in the development code to reuse the cached plugin credentials.

Sample: Construct IntelliJCredential

The following code sample demonstrates the creation of a IntelliJCredential, using the IntelliJCredentialBuilder to configure it. Once this credential is created, it may be passed into the builder of many of the Azure SDK for Java client builders as the 'credential' parameter.

 TokenCredential intelliJCredential = new IntelliJCredentialBuilder()
     .build();
 
See Also:
  • Method Details

    • getToken

      public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request)
      Specified by:
      getToken in interface com.azure.core.credential.TokenCredential