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

90 строки
9.6 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.identity.ChainedTokenCredentialBuilder"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder"
name: "ChainedTokenCredentialBuilder"
nameWithType: "ChainedTokenCredentialBuilder"
summary: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref>."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- 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 **ChainedTokenCredentialBuilder**"
constructors:
- uid: "com.azure.identity.ChainedTokenCredentialBuilder.ChainedTokenCredentialBuilder()"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder.ChainedTokenCredentialBuilder()"
name: "ChainedTokenCredentialBuilder()"
nameWithType: "ChainedTokenCredentialBuilder.ChainedTokenCredentialBuilder()"
summary: "Creates an instance of the builder to config the credential."
syntax: "public ChainedTokenCredentialBuilder()"
desc: "Creates an instance of the builder to config the credential."
methods:
- uid: "com.azure.identity.ChainedTokenCredentialBuilder.addAll(java.util.Collection<? extends com.azure.core.credential.TokenCredential>)"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder.addAll(Collection<? extends TokenCredential> credentials)"
name: "addAll(Collection<? extends TokenCredential> credentials)"
nameWithType: "ChainedTokenCredentialBuilder.addAll(Collection<? extends TokenCredential> credentials)"
summary: "Adds all of the credentials in the specified collection at the end of this chain, as if by calling <xref uid=\"com.azure.identity.ChainedTokenCredentialBuilder.addLast(com.azure.core.credential.TokenCredential)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredentialBuilder#addLast(TokenCredential)\"></xref> on each one, in the order that they are returned by the collection's iterator."
parameters:
- description: "the collection of credentials to be appended to the chain."
name: "credentials"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html\">Collection</a>&lt;<xref href=\"? extends com.azure.core.credential.TokenCredential?alt=? extends com.azure.core.credential.TokenCredential&text=TokenCredential\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public ChainedTokenCredentialBuilder addAll(Collection<? extends TokenCredential> credentials)"
desc: "Adds all of the credentials in the specified collection at the end of this chain, as if by calling <xref uid=\"com.azure.identity.ChainedTokenCredentialBuilder.addLast(com.azure.core.credential.TokenCredential)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredentialBuilder#addLast(TokenCredential)\"></xref> on each one, in the order that they are returned by the collection's iterator."
returns:
description: "An updated instance of the builder."
type: "<xref href=\"com.azure.identity.ChainedTokenCredentialBuilder?alt=com.azure.identity.ChainedTokenCredentialBuilder&text=ChainedTokenCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ChainedTokenCredentialBuilder.addFirst(com.azure.core.credential.TokenCredential)"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder.addFirst(TokenCredential credential)"
name: "addFirst(TokenCredential credential)"
nameWithType: "ChainedTokenCredentialBuilder.addFirst(TokenCredential credential)"
summary: "Adds a credential to try to authenticate at the front of the chain."
parameters:
- description: "the credential to be added to the front of chain"
name: "credential"
type: "<xref href=\"com.azure.core.credential.TokenCredential?alt=com.azure.core.credential.TokenCredential&text=TokenCredential\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ChainedTokenCredentialBuilder addFirst(TokenCredential credential)"
desc: "Adds a credential to try to authenticate at the front of the chain."
returns:
description: "the ChainedTokenCredential itself"
type: "<xref href=\"com.azure.identity.ChainedTokenCredentialBuilder?alt=com.azure.identity.ChainedTokenCredentialBuilder&text=ChainedTokenCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ChainedTokenCredentialBuilder.addLast(com.azure.core.credential.TokenCredential)"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder.addLast(TokenCredential credential)"
name: "addLast(TokenCredential credential)"
nameWithType: "ChainedTokenCredentialBuilder.addLast(TokenCredential credential)"
summary: "Adds a credential to try to authenticate at the last of the chain."
parameters:
- description: "the credential to be added to the end of chain"
name: "credential"
type: "<xref href=\"com.azure.core.credential.TokenCredential?alt=com.azure.core.credential.TokenCredential&text=TokenCredential\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ChainedTokenCredentialBuilder addLast(TokenCredential credential)"
desc: "Adds a credential to try to authenticate at the last of the chain."
returns:
description: "the ChainedTokenCredential itself"
type: "<xref href=\"com.azure.identity.ChainedTokenCredentialBuilder?alt=com.azure.identity.ChainedTokenCredentialBuilder&text=ChainedTokenCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.ChainedTokenCredentialBuilder.build()"
fullName: "com.azure.identity.ChainedTokenCredentialBuilder.build()"
name: "build()"
nameWithType: "ChainedTokenCredentialBuilder.build()"
summary: "Creates a new <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref> with the current configurations."
syntax: "public ChainedTokenCredential build()"
desc: "Creates a new <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref> with the current configurations."
returns:
description: "a <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref> with the current configurations."
type: "<xref href=\"com.azure.identity.ChainedTokenCredential?alt=com.azure.identity.ChainedTokenCredential&text=ChainedTokenCredential\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref>. The <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ChainedTokenCredential\"></xref> is a convenience credential that allows users to chain together a set of TokenCredential together. The credential executes each credential in the chain sequentially and returns the token from the first credential in the chain that successfully authenticates.\n\n**Sample: Construct a ChainedTokenCredential.**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.ChainedTokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ChainedTokenCredential\"></xref>, using the <xref uid=\"com.azure.identity.ChainedTokenCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.ChainedTokenCredentialBuilder\"></xref> to configure it. The sample below tries silent username+password login tried first, then interactive browser login as needed (e.g. when 2FA is turned on in the directory). 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 usernamePasswordCredential = new UsernamePasswordCredentialBuilder()\n .clientId(clientId)\n .username(fakeUsernamePlaceholder)\n .password(fakePasswordPlaceholder)\n .build();\n TokenCredential interactiveBrowserCredential = new InteractiveBrowserCredentialBuilder()\n .clientId(clientId)\n .port(8765)\n .build();\n TokenCredential credential = new ChainedTokenCredentialBuilder()\n .addLast(usernamePasswordCredential)\n .addLast(interactiveBrowserCredential)\n .build();\n```"
metadata: {}
package: "com.azure.identity"
artifact: com.azure:azure-identity:1.13.3