172 строки
14 KiB
YAML
172 строки
14 KiB
YAML
### YamlMime:JavaType
|
|
uid: "com.azure.core.credential.TokenRequestContext"
|
|
fullName: "com.azure.core.credential.TokenRequestContext"
|
|
name: "TokenRequestContext"
|
|
nameWithType: "TokenRequestContext"
|
|
summary: "The <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref> is a class used to provide additional information and context when requesting an access token from an authentication source."
|
|
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 **TokenRequestContext**"
|
|
constructors:
|
|
- uid: "com.azure.core.credential.TokenRequestContext.TokenRequestContext()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.TokenRequestContext()"
|
|
name: "TokenRequestContext()"
|
|
nameWithType: "TokenRequestContext.TokenRequestContext()"
|
|
summary: "Creates a token request instance."
|
|
syntax: "public TokenRequestContext()"
|
|
desc: "Creates a token request instance."
|
|
methods:
|
|
- uid: "com.azure.core.credential.TokenRequestContext.addScopes(java.lang.String...)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.addScopes(String[] scopes)"
|
|
name: "addScopes(String[] scopes)"
|
|
nameWithType: "TokenRequestContext.addScopes(String[] scopes)"
|
|
summary: "Adds one or more scopes to the request scopes."
|
|
parameters:
|
|
- description: "one or more scopes to add"
|
|
name: "scopes"
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>[]"
|
|
syntax: "public TokenRequestContext addScopes(String[] scopes)"
|
|
desc: "Adds one or more scopes to the request scopes."
|
|
returns:
|
|
description: "the TokenRequestContext itself"
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.getClaims()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.getClaims()"
|
|
name: "getClaims()"
|
|
nameWithType: "TokenRequestContext.getClaims()"
|
|
summary: "Get the additional claims to be included in the token."
|
|
syntax: "public String getClaims()"
|
|
desc: "Get the additional claims to be included in the token."
|
|
returns:
|
|
description: "the additional claims to be included in the token."
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.getProofOfPossessionOptions()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.getProofOfPossessionOptions()"
|
|
name: "getProofOfPossessionOptions()"
|
|
nameWithType: "TokenRequestContext.getProofOfPossessionOptions()"
|
|
summary: "Gets the proof of possession options."
|
|
syntax: "public ProofOfPossessionOptions getProofOfPossessionOptions()"
|
|
desc: "Gets the proof of possession options."
|
|
returns:
|
|
description: "The current instance of ProofOfPossessionOptions."
|
|
type: "<xref href=\"com.azure.core.credential.ProofOfPossessionOptions?alt=com.azure.core.credential.ProofOfPossessionOptions&text=ProofOfPossessionOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.getScopes()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.getScopes()"
|
|
name: "getScopes()"
|
|
nameWithType: "TokenRequestContext.getScopes()"
|
|
summary: "Gets the scopes required for the token."
|
|
syntax: "public List<String> getScopes()"
|
|
desc: "Gets the scopes required for the token."
|
|
returns:
|
|
description: "the scopes required for the token"
|
|
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>>"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.getTenantId()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.getTenantId()"
|
|
name: "getTenantId()"
|
|
nameWithType: "TokenRequestContext.getTenantId()"
|
|
summary: "Get the tenant id to be used for the authentication request."
|
|
syntax: "public String getTenantId()"
|
|
desc: "Get the tenant id to be used for the authentication request."
|
|
returns:
|
|
description: "the configured tenant id."
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.isCaeEnabled()"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.isCaeEnabled()"
|
|
name: "isCaeEnabled()"
|
|
nameWithType: "TokenRequestContext.isCaeEnabled()"
|
|
summary: "Get the status indicating whether Continuous Access Evaluation (CAE) is enabled for the requested token."
|
|
syntax: "public boolean isCaeEnabled()"
|
|
desc: "Get the status indicating whether Continuous Access Evaluation (CAE) is enabled for the requested token."
|
|
returns:
|
|
description: "the flag indicating whether CAE authentication should be used or not."
|
|
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.setCaeEnabled(boolean)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.setCaeEnabled(boolean enableCae)"
|
|
name: "setCaeEnabled(boolean enableCae)"
|
|
nameWithType: "TokenRequestContext.setCaeEnabled(boolean enableCae)"
|
|
summary: "Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token."
|
|
parameters:
|
|
- description: "the flag indicating whether to enable Continuous Access Evaluation (CAE) for\n the requested token."
|
|
name: "enableCae"
|
|
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public TokenRequestContext setCaeEnabled(boolean enableCae)"
|
|
desc: "Indicates whether to enable Continuous Access Evaluation (CAE) for the requested token.\n\nIf a resource API implements CAE and your application declares it can handle CAE, your app receives CAE tokens for that resource. For this reason, if you declare your app CAE ready, your application must handle the CAE claim challenge for all resource APIs that accept Microsoft Identity access tokens. If you don't handle CAE responses in these API calls, your app could end up in a loop retrying an API call with a token that is still in the returned lifespan of the token but has been revoked due to CAE."
|
|
returns:
|
|
description: "the updated TokenRequestContext."
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.setClaims(java.lang.String)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.setClaims(String claims)"
|
|
name: "setClaims(String claims)"
|
|
nameWithType: "TokenRequestContext.setClaims(String claims)"
|
|
summary: "Set the additional claims to be included in the token."
|
|
parameters:
|
|
- description: "the additional claims to be included in the token."
|
|
name: "claims"
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
|
|
syntax: "public TokenRequestContext setClaims(String claims)"
|
|
desc: "Set the additional claims to be included in the token."
|
|
returns:
|
|
description: "the updated TokenRequestContext itself"
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.setProofOfPossessionOptions(com.azure.core.credential.ProofOfPossessionOptions)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.setProofOfPossessionOptions(ProofOfPossessionOptions proofOfPossessionOptions)"
|
|
name: "setProofOfPossessionOptions(ProofOfPossessionOptions proofOfPossessionOptions)"
|
|
nameWithType: "TokenRequestContext.setProofOfPossessionOptions(ProofOfPossessionOptions proofOfPossessionOptions)"
|
|
summary: "Sets the proof of possession options."
|
|
parameters:
|
|
- description: "An instance of ProofOfPossessionOptions to be set."
|
|
name: "proofOfPossessionOptions"
|
|
type: "<xref href=\"com.azure.core.credential.ProofOfPossessionOptions?alt=com.azure.core.credential.ProofOfPossessionOptions&text=ProofOfPossessionOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public TokenRequestContext setProofOfPossessionOptions(ProofOfPossessionOptions proofOfPossessionOptions)"
|
|
desc: "Sets the proof of possession options."
|
|
returns:
|
|
description: "The updated instance of TokenRequestContext."
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.setScopes(java.util.List<java.lang.String>)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.setScopes(List<String> scopes)"
|
|
name: "setScopes(List<String> scopes)"
|
|
nameWithType: "TokenRequestContext.setScopes(List<String> scopes)"
|
|
summary: "Sets the scopes required for the token."
|
|
parameters:
|
|
- description: "the scopes required for the token"
|
|
name: "scopes"
|
|
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 TokenRequestContext setScopes(List<String> scopes)"
|
|
desc: "Sets the scopes required for the token."
|
|
returns:
|
|
description: "the TokenRequestContext itself"
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- uid: "com.azure.core.credential.TokenRequestContext.setTenantId(java.lang.String)"
|
|
fullName: "com.azure.core.credential.TokenRequestContext.setTenantId(String tenantId)"
|
|
name: "setTenantId(String tenantId)"
|
|
nameWithType: "TokenRequestContext.setTenantId(String tenantId)"
|
|
summary: "Set the tenant id to be used for the authentication request."
|
|
parameters:
|
|
- description: "the tenant to be used when requesting the token."
|
|
name: "tenantId"
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
|
|
syntax: "public TokenRequestContext setTenantId(String tenantId)"
|
|
desc: "Set the tenant id to be used for the authentication request."
|
|
returns:
|
|
description: "the updated TokenRequestContext itself"
|
|
type: "<xref href=\"com.azure.core.credential.TokenRequestContext?alt=com.azure.core.credential.TokenRequestContext&text=TokenRequestContext\" data-throw-if-not-resolved=\"False\" />"
|
|
type: "class"
|
|
desc: "The <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref> is a class used to provide additional information and context when requesting an access token from an authentication source. It allows you to customize the token request and specify additional parameters, such as scopes, claims, or authentication options.\n\nThe <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref> is typically used with authentication mechanisms that require more advanced configurations or options, such as [Azure Active Directory (Azure AD)][Azure Active Directory _Azure AD] authentication.\n\nHere's a high-level overview of how you can use the <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref>:\n\n1. Create an instance of the <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref> class and configure the required properties. The <xref uid=\"com.azure.core.credential.TokenRequestContext\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenRequestContext\"></xref> class allows you to specify the scopes or resources for which you want to request an access token, as well as any additional claims or options.\n2. Pass the TokenRequestContext instance to the appropriate authentication client or mechanism when requesting an access token. The specific method or API to do this will depend on the authentication mechanism you are using. For example, if you are using Azure Identity for AAD authentication, you would pass the TokenRequestContext instance to the getToken method of the <xref uid=\"com.azure.core.credential.TokenCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TokenCredential\"></xref> implementation.\n3. The authentication client or mechanism will handle the token request and return an access token that can be used to authenticate and authorize requests to Azure services.\n\n\n[Azure Active Directory _Azure AD]: https://learn.microsoft.com/azure/active-directory/fundamentals/"
|
|
metadata: {}
|
|
package: "com.azure.core.credential"
|
|
artifact: com.azure:azure-core:1.54.0
|