你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IntelliJCredentialBuilder 类

public class IntelliJCredentialBuilder
extends CredentialBuilderBase<VisualStudioCodeCredentialBuilder>

用于实例化 的 IntelliJCredentialFluent 凭据生成器。

IntelliJ IDEA 是 JetBrains 开发 (IDE) 的集成开发环境,它提供各种功能来支持软件开发,例如代码完成、调试和测试。 Azure 为 IntelliJ IDEA 开发环境提供 Azure Toolkit for IntelliJ 插件 。 它使开发人员能够创建、测试 Java 应用程序并将其部署到 Azure 云平台。 若要以用户或服务主体的身份对 Azure Active Directory 使用插件身份验证, (需要 Azure AD) 。 在 IntelliJCredential 开发环境中进行身份验证,并代表 Azure Toolkit for IntelliJ 中的登录帐户获取令牌。 它使用 IntelliJ IDE 上登录的用户信息,并使用它根据 Azure Active Directory 对应用程序进行身份验证。

示例:构造 IntelliJCredential

下面的代码示例演示如何创建 IntelliJCredential,使用 IntelliJCredentialBuilder 对其进行配置。 创建此凭据后,它可能会作为“credential”参数传递到许多 Azure SDK for Java 客户端生成器的生成器中。

TokenCredential intelliJCredential = new IntelliJCredentialBuilder()
     .build();

构造函数摘要

构造函数 说明
IntelliJCredentialBuilder()

方法摘要

修饰符和类型 方法和描述
IntelliJCredentialBuilder additionallyAllowedTenants(String[] additionallyAllowedTenants)

除了指定租户 ID 之外,还指定凭据可能为其获取令牌的租户

IntelliJCredentialBuilder additionallyAllowedTenants(List<String> additionallyAllowedTenants)

除了指定租户 ID 之外,还指定凭据可能为其获取令牌的租户

IntelliJCredential build()

使用当前配置创建新的 IntelliJCredential

IntelliJCredentialBuilder keePassDatabasePath(String databasePath)

指定用于读取用于 IntelliJ 插件的 Azure 工具包的缓存凭据的 KeePass 数据库路径。

IntelliJCredentialBuilder tenantId(String tenantId)

设置要通过 IntelliJCredential进行身份验证的用户的租户 ID。

方法继承自 CredentialBuilderBase

方法继承自 java.lang.Object

构造函数详细信息

IntelliJCredentialBuilder

public IntelliJCredentialBuilder()

方法详细信息

additionallyAllowedTenants

public IntelliJCredentialBuilder additionallyAllowedTenants(String[] additionallyAllowedTenants)

除了指定凭据可能获取令牌的指定 tenantId 之外,还指定租户。 添加通配符值“*”,以允许凭据为登录帐户可以访问的任何租户获取令牌。 如果未为 tenantId 指定值,此选项将不起作用,并且凭据将获取任何请求租户的令牌。

Parameters:

additionallyAllowedTenants - 其他允许的租户。

Returns:

此生成器的更新实例,其中配置了其他租户。

additionallyAllowedTenants

public IntelliJCredentialBuilder additionallyAllowedTenants(List additionallyAllowedTenants)

除了指定凭据可能获取令牌的指定 tenantId 之外,还指定租户。 添加通配符值“*”,以允许凭据为登录帐户可以访问的任何租户获取令牌。 如果未为 tenantId 指定值,此选项将不起作用,并且凭据将获取任何请求租户的令牌。

Parameters:

additionallyAllowedTenants - 其他允许的租户。

Returns:

此生成器的更新实例,其中配置了其他租户。

build

public IntelliJCredential build()

使用当前配置创建新的 IntelliJCredential

Returns:

具有 IntelliJCredential 当前配置的 。

keePassDatabasePath

public IntelliJCredentialBuilder keePassDatabasePath(String databasePath)

指定用于读取用于 IntelliJ 插件的 Azure 工具包的缓存凭据的 KeePass 数据库路径。 databasePath在 Windows 平台上需要 。 对于 macOS 和 Linux 平台,将分别访问本机密钥链/密钥环以检索缓存的凭据。

此路径可以位于 IntelliJ IDE 中。 Windows:文件 -> 设置 -> 外观 & 行为 -> 系统设置 -> 密码。

Parameters:

databasePath - KeePass 数据库的路径。

Returns:

此生成器的更新实例,其中设置了指定的 KeePass 数据库路径。

tenantId

public IntelliJCredentialBuilder tenantId(String tenantId)

设置要通过 IntelliJCredential进行身份验证的用户的租户 ID。 默认为用户最初通过 Azure Toolkit for IntelliJ 插件进行身份验证的租户。

Parameters:

tenantId - 要设置的租户 ID。

Returns:

此生成器的更新实例,其中设置了指定的租户 ID。

适用于