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 Summary

    Modifier and Type
    Method
    Description
    Mono<com.azure.core.credential.AccessToken>
    getToken(com.azure.core.credential.TokenRequestContext request)
    Asynchronously get a token for a given resource/audience.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.core.credential.TokenCredential

    getTokenSync
  • Method Details

    • getToken

      public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request)
      Description copied from interface: com.azure.core.credential.TokenCredential
      Asynchronously get a token for a given resource/audience. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.
      Specified by:
      getToken in interface com.azure.core.credential.TokenCredential
      Parameters:
      request - the details of the token request
      Returns:
      a Publisher that emits a single access token