/
com.azure.identity.DeviceCodeCredentialBuilder.yml
156 lines (156 loc) · 23 KB
/
com.azure.identity.DeviceCodeCredentialBuilder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
### YamlMime:JavaType
uid: "com.azure.identity.DeviceCodeCredentialBuilder"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder"
name: "DeviceCodeCredentialBuilder"
nameWithType: "DeviceCodeCredentialBuilder"
summary: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></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 **DeviceCodeCredentialBuilder**</br> extends <xref href=\"com.azure.identity.AadCredentialBuilderBase?alt=com.azure.identity.AadCredentialBuilderBase&text=AadCredentialBuilderBase\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />>"
constructors:
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.DeviceCodeCredentialBuilder()"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.DeviceCodeCredentialBuilder()"
name: "DeviceCodeCredentialBuilder()"
nameWithType: "DeviceCodeCredentialBuilder.DeviceCodeCredentialBuilder()"
summary: "Constructs an instance of Device<wbr>Code<wbr>Credential<wbr>Builder."
syntax: "public DeviceCodeCredentialBuilder()"
desc: "Constructs an instance of DeviceCodeCredentialBuilder."
methods:
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.additionallyAllowedTenants(java.lang.String...)"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.additionallyAllowedTenants(String[] additionallyAllowedTenants)"
name: "additionallyAllowedTenants(String[] additionallyAllowedTenants)"
nameWithType: "DeviceCodeCredentialBuilder.additionallyAllowedTenants(String[] additionallyAllowedTenants)"
summary: "For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens."
overridden: "com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.lang.String...)"
parameters:
- description: "the additionally allowed tenants."
name: "additionallyAllowedTenants"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>[]"
syntax: "public DeviceCodeCredentialBuilder additionallyAllowedTenants(String[] additionallyAllowedTenants)"
desc: "For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value \"\\*\" to allow the credential to acquire tokens for any tenant on which the application is installed. If no value is specified for TenantId this option will have no effect, and the credential will acquire tokens for any requested tenant."
returns:
description: "An updated instance of this builder with the additional tenants configured."
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.additionallyAllowedTenants(java.util.List<java.lang.String>)"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.additionallyAllowedTenants(List<String> additionallyAllowedTenants)"
name: "additionallyAllowedTenants(List<String> additionallyAllowedTenants)"
nameWithType: "DeviceCodeCredentialBuilder.additionallyAllowedTenants(List<String> additionallyAllowedTenants)"
summary: "For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens."
overridden: "com.azure.identity.AadCredentialBuilderBase.additionallyAllowedTenants(java.util.List<java.lang.String>)"
parameters:
- description: "the additionally allowed tenants."
name: "additionallyAllowedTenants"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>>"
syntax: "public DeviceCodeCredentialBuilder additionallyAllowedTenants(List<String> additionallyAllowedTenants)"
desc: "For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value \"\\*\" to allow the credential to acquire tokens for any tenant on which the application is installed. If no value is specified for TenantId this option will have no effect, and the credential will acquire tokens for any requested tenant."
returns:
description: "An updated instance of this builder with the additional tenants configured."
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.authenticationRecord(com.azure.identity.AuthenticationRecord)"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.authenticationRecord(AuthenticationRecord authenticationRecord)"
name: "authenticationRecord(AuthenticationRecord authenticationRecord)"
nameWithType: "DeviceCodeCredentialBuilder.authenticationRecord(AuthenticationRecord authenticationRecord)"
summary: "Sets the <xref uid=\"com.azure.identity.AuthenticationRecord\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AuthenticationRecord\"></xref> captured from a previous authentication."
parameters:
- description: "the authentication record to be configured."
name: "authenticationRecord"
type: "<xref href=\"com.azure.identity.AuthenticationRecord?alt=com.azure.identity.AuthenticationRecord&text=AuthenticationRecord\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceCodeCredentialBuilder authenticationRecord(AuthenticationRecord authenticationRecord)"
desc: "Sets the <xref uid=\"com.azure.identity.AuthenticationRecord\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AuthenticationRecord\"></xref> captured from a previous authentication."
returns:
description: "An updated instance of this builder with the configured authentication record."
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.build()"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.build()"
name: "build()"
nameWithType: "DeviceCodeCredentialBuilder.build()"
summary: "Creates a new <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref> with the current configurations."
syntax: "public DeviceCodeCredential build()"
desc: "Creates a new <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref> with the current configurations."
returns:
description: "a <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref> with the current configurations."
type: "<xref href=\"com.azure.identity.DeviceCodeCredential?alt=com.azure.identity.DeviceCodeCredential&text=DeviceCodeCredential\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.challengeConsumer(java.util.function.Consumer<com.azure.identity.DeviceCodeInfo>)"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)"
name: "challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)"
nameWithType: "DeviceCodeCredentialBuilder.challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)"
summary: "Sets the consumer to meet the device code challenge."
parameters:
- description: "A method allowing the user to meet the device code challenge."
name: "challengeConsumer"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html\">Consumer</a><<xref href=\"com.azure.identity.DeviceCodeInfo?alt=com.azure.identity.DeviceCodeInfo&text=DeviceCodeInfo\" data-throw-if-not-resolved=\"False\" />>"
syntax: "public DeviceCodeCredentialBuilder challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)"
desc: "Sets the consumer to meet the device code challenge. If not specified a default consumer is used which prints the device code info message to stdout."
returns:
description: "the InteractiveBrowserCredentialBuilder itself"
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.disableAutomaticAuthentication()"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.disableAutomaticAuthentication()"
name: "disableAutomaticAuthentication()"
nameWithType: "DeviceCodeCredentialBuilder.disableAutomaticAuthentication()"
summary: "Disables the automatic authentication and prevents the <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref> from automatically prompting the user."
syntax: "public DeviceCodeCredentialBuilder disableAutomaticAuthentication()"
desc: "Disables the automatic authentication and prevents the <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref> from automatically prompting the user. If automatic authentication is disabled a <xref uid=\"com.azure.identity.AuthenticationRequiredException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AuthenticationRequiredException\"></xref> will be thrown from <xref uid=\"com.azure.identity.DeviceCodeCredential.getToken(com.azure.core.credential.TokenRequestContext)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential#getToken(TokenRequestContext)\"></xref> in the case that user interaction is necessary. The application is responsible for handling this exception, and calling <xref uid=\"com.azure.identity.DeviceCodeCredential.authenticate()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential#authenticate()\"></xref> or <xref uid=\"com.azure.identity.DeviceCodeCredential.authenticate(com.azure.core.credential.TokenRequestContext)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential#authenticate(TokenRequestContext)\"></xref> to authenticate the user interactively."
returns:
description: "An updated instance of this builder with automatic authentication disabled."
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.identity.DeviceCodeCredentialBuilder.tokenCachePersistenceOptions(com.azure.identity.TokenCachePersistenceOptions)"
fullName: "com.azure.identity.DeviceCodeCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
name: "tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
nameWithType: "DeviceCodeCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
summary: "Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default."
parameters:
- description: "the token cache configuration options"
name: "tokenCachePersistenceOptions"
type: "<xref href=\"com.azure.identity.TokenCachePersistenceOptions?alt=com.azure.identity.TokenCachePersistenceOptions&text=TokenCachePersistenceOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public DeviceCodeCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)"
desc: "Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default. If configured, the credential will store tokens in a cache persisted to the machine, protected to the current user, which can be shared by other credentials and processes."
returns:
description: "An updated instance of this builder with the token cache options configured."
type: "<xref href=\"com.azure.identity.DeviceCodeCredentialBuilder?alt=com.azure.identity.DeviceCodeCredentialBuilder&text=DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Fluent credential builder for instantiating a <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DeviceCodeCredential\"></xref>.\n\nDevice code authentication is a type of authentication flow offered by [Microsoft Entra ID][] that allows users to sign in to applications on devices that don't have a web browser or a keyboard. This authentication method is particularly useful for devices such as smart TVs, gaming consoles, and Internet of Things (IoT) devices that may not have the capability to enter a username and password. With device code authentication, the user is presented with a device code on the device that needs to be authenticated. The user then navigates to a web browser on a separate device and enters the code on the Microsoft sign-in page. After the user enters the code, Microsoft Entra ID verifies it and prompts the user to sign in with their credentials, such as a username and password or a multi-factor authentication (MFA) method. Device code authentication can be initiated using various Microsoft Entra-supported protocols, such as OAuth 2.0 and OpenID Connect, and it can be used with a wide range of Microsoft Entra-integrated applications. The DeviceCodeCredential interactively authenticates a user and acquires a token on devices with limited UI. It works by prompting the user to visit a login URL on a browser-enabled machine when the application attempts to authenticate. The user then enters the device code mentioned in the instructions along with their login credentials. Upon successful authentication, the application that requested authentication gets authenticated successfully on the device it's running on. For more information refer to the [conceptual knowledge and configuration details][].\n\nThese steps will let the application authenticate, but it still won't have permission to log you into Active Directory, or access resources on your behalf. To address this issue, navigate to API Permissions, and enable Microsoft Graph and the resources you want to access, such as Azure Service Management, Key Vault, and so on. You also need to be the admin of your tenant to grant consent to your application when you log in for the first time. If you can't configure the device code flow option on your Active Directory, then it may require your app to be multi- tenant. To make your app multi-tenant, navigate to the Authentication panel, then select Accounts in any organizational directory. Then, select yes for Treat application as Public Client.\n\n**Sample: Construct DeviceCodeCredential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.identity.DeviceCodeCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.DeviceCodeCredential\"></xref>, using the <xref uid=\"com.azure.identity.DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.DeviceCodeCredentialBuilder\"></xref> to configure it. By default, the credential prints the device code challenge on the command line, to override that behaviours a `challengeConsumer` can be optionally specified on the <xref uid=\"com.azure.identity.DeviceCodeCredentialBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.identity.DeviceCodeCredentialBuilder\"></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 deviceCodeCredential = new DeviceCodeCredentialBuilder()\n .build();\n```\n\n\n[Microsoft Entra ID]: https://learn.microsoft.com/entra/fundamentals/\n[conceptual knowledge and configuration details]: https://aka.ms/azsdk/java/identity/devicecodecredential/docs"
metadata: {}
package: "com.azure.identity"
artifact: com.azure:azure-identity:1.12.1