azure-docs-sdk-java/docs-ref-autogen/com.azure.identity.Workload...

89 строки
13 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.identity.WorkloadIdentityCredentialBuilder"
fullName: "com.azure.identity.WorkloadIdentityCredentialBuilder"
name: "WorkloadIdentityCredentialBuilder"
nameWithType: "WorkloadIdentityCredentialBuilder"
summary: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref>."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "<xref href=\"com.azure.identity.AadCredentialBuilderBase?alt=com.azure.identity.AadCredentialBuilderBase&text=AadCredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.lang.String...)?alt=com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants&text=additionallyAllowedTenants\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.util.List<java.lang.String>)?alt=com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants&text=additionallyAllowedTenants\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.authorityHost(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.authorityHost&text=authorityHost\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.clientId(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.clientId&text=clientId\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.disableInstanceDiscovery()?alt=com.azure.identity.AadCredentialBuilderBase.disableInstanceDiscovery&text=disableInstanceDiscovery\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.enableUnsafeSupportLogging()?alt=com.azure.identity.AadCredentialBuilderBase.enableUnsafeSupportLogging&text=enableUnsafeSupportLogging\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.executorService(java.util.concurrent.ExecutorService)?alt=com.azure.identity.AadCredentialBuilderBase.executorService&text=executorService\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.AadCredentialBuilderBase.tenantId(java.lang.String)?alt=com.azure.identity.AadCredentialBuilderBase.tenantId&text=tenantId\" data-throw-if-not-resolved=\"False\" />"
- classRef: "<xref href=\"com.azure.identity.CredentialBuilderBase?alt=com.azure.identity.CredentialBuilderBase&text=CredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />"
methodsRef:
- "<xref href=\"com.azure.identity.CredentialBuilderBase.addPolicy(com.azure.core.http.policy.HttpPipelinePolicy)?alt=com.azure.identity.CredentialBuilderBase.addPolicy&text=addPolicy\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.clientOptions(com.azure.core.util.ClientOptions)?alt=com.azure.identity.CredentialBuilderBase.clientOptions&text=clientOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.configuration(com.azure.core.util.Configuration)?alt=com.azure.identity.CredentialBuilderBase.configuration&text=configuration\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.enableAccountIdentifierLogging()?alt=com.azure.identity.CredentialBuilderBase.enableAccountIdentifierLogging&text=enableAccountIdentifierLogging\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpClient(com.azure.core.http.HttpClient)?alt=com.azure.identity.CredentialBuilderBase.httpClient&text=httpClient\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpLogOptions(com.azure.core.http.policy.HttpLogOptions)?alt=com.azure.identity.CredentialBuilderBase.httpLogOptions&text=httpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.httpPipeline(com.azure.core.http.HttpPipeline)?alt=com.azure.identity.CredentialBuilderBase.httpPipeline&text=httpPipeline\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.maxRetry(int)?alt=com.azure.identity.CredentialBuilderBase.maxRetry&text=maxRetry\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.pipeline(com.azure.core.http.HttpPipeline)?alt=com.azure.identity.CredentialBuilderBase.pipeline&text=pipeline\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.proxyOptions(com.azure.core.http.ProxyOptions)?alt=com.azure.identity.CredentialBuilderBase.proxyOptions&text=proxyOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryOptions(com.azure.core.http.policy.RetryOptions)?alt=com.azure.identity.CredentialBuilderBase.retryOptions&text=retryOptions\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryPolicy(com.azure.core.http.policy.RetryPolicy)?alt=com.azure.identity.CredentialBuilderBase.retryPolicy&text=retryPolicy\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.identity.CredentialBuilderBase.retryTimeout(java.util.function.Function<java.time.Duration,java.time.Duration>)?alt=com.azure.identity.CredentialBuilderBase.retryTimeout&text=retryTimeout\" data-throw-if-not-resolved=\"False\" />"
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **WorkloadIdentityCredentialBuilder**</br> extends <xref href=\"com.azure.identity.AadCredentialBuilderBase?alt=com.azure.identity.AadCredentialBuilderBase&text=AadCredentialBuilderBase\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.identity.WorkloadIdentityCredentialBuilder?alt=com.azure.identity.WorkloadIdentityCredentialBuilder&text=WorkloadIdentityCredentialBuilder\" data-throw-if-not-resolved=\"False\" />&gt;"
constructors:
- uid: "com.azure.identity.WorkloadIdentityCredentialBuilder.WorkloadIdentityCredentialBuilder()"
fullName: "com.azure.identity.WorkloadIdentityCredentialBuilder.WorkloadIdentityCredentialBuilder()"
name: "WorkloadIdentityCredentialBuilder()"
nameWithType: "WorkloadIdentityCredentialBuilder.WorkloadIdentityCredentialBuilder()"
summary: "Creates an instance of a Workload<wbr>Identity<wbr>Credential<wbr>Builder."
syntax: "public WorkloadIdentityCredentialBuilder()"
desc: "Creates an instance of a WorkloadIdentityCredentialBuilder."
methods:
- uid: "com.azure.identity.WorkloadIdentityCredentialBuilder.build()"
fullName: "com.azure.identity.WorkloadIdentityCredentialBuilder.build()"
name: "build()"
nameWithType: "WorkloadIdentityCredentialBuilder.build()"
summary: "Creates new <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref> with the configured options set."
syntax: "public WorkloadIdentityCredential build()"
desc: "Creates new <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref> with the configured options set."
returns:
description: "a <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref> with the current configurations."
type: "<xref href=\"com.azure.identity.WorkloadIdentityCredential?alt=com.azure.identity.WorkloadIdentityCredential&text=WorkloadIdentityCredential\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.WorkloadIdentityCredentialBuilder.tokenFilePath(java.lang.String)"
fullName: "com.azure.identity.WorkloadIdentityCredentialBuilder.tokenFilePath(String tokenFilePath)"
name: "tokenFilePath(String tokenFilePath)"
nameWithType: "WorkloadIdentityCredentialBuilder.tokenFilePath(String tokenFilePath)"
summary: "Configure the path to a file containing a Kubernetes service account token that authenticates the identity."
parameters:
- description: "the path to the file containing the token to use for authentication."
name: "tokenFilePath"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public WorkloadIdentityCredentialBuilder tokenFilePath(String tokenFilePath)"
desc: "Configure the path to a file containing a Kubernetes service account token that authenticates the identity. The file path is required to authenticate."
returns:
description: "An updated instance of this builder with the tenant id set as specified."
type: "<xref href=\"com.azure.identity.WorkloadIdentityCredentialBuilder?alt=com.azure.identity.WorkloadIdentityCredentialBuilder&text=WorkloadIdentityCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref>.\n\nWorkload Identity authentication is a feature in Azure that allows applications running on virtual machines (VMs) to access other Azure resources without the need for a service principal or managed identity. With Workload Identity authentication, applications authenticate themselves using their own identity, rather than using a shared service principal or managed identity. Under the hood, Workload Identity authentication uses the concept of Service Account Credentials (SACs), which are automatically created by Azure and stored securely in the VM. By using Workload Identity authentication, you can avoid the need to manage and rotate service principals or managed identities for each application on each VM. Additionally, because SACs are created automatically and managed by Azure, you don't need to worry about storing and securing sensitive credentials themselves. The WorkloadIdentityCredential supports Azure workload identity authentication on Azure Kubernetes and acquires a token using the service account credentials available in the Azure Kubernetes environment. Refer to [Microsoft Entra Workload ID][] for more information.\n\n**Sample: Construct WorkloadIdentityCredential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref>, using the <xref uid=\"com.azure.identity.WorkloadIdentityCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredentialBuilder\"></xref> to configure it. The `clientId`, is required to create <xref uid=\"com.azure.identity.WorkloadIdentityCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"WorkloadIdentityCredential\"></xref>. 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.\n\n```java\nTokenCredential workloadIdentityCredential = new WorkloadIdentityCredentialBuilder()\n .clientId(\"<clientID>\")\n .tenantId(\"<tenantID>\")\n .tokenFilePath(\"<token-file-path>\")\n .build();\n```\n\n\n[Microsoft Entra Workload ID]: https://learn.microsoft.com/azure/aks/workload-identity-overview"
metadata: {}
package: "com.azure.identity"
artifact: com.azure:azure-identity:1.13.3