AzureKeyCredential Class
- java.
lang. Object - com.
azure. core. credential. KeyCredential - com.
azure. core. credential. AzureKeyCredential
- com.
- com.
public final class AzureKeyCredential
extends KeyCredential
The AzureKeyCredential is used to authenticate and authorize requests made to Azure services. It is specifically designed for scenarios where you need to authenticate using a key.
A key is a unique identifier or token that is associated with a specific user or application. It serves as a simple form of authentication to ensure that only authorized clients can access the protected resources or APIs. This authentication is commonly used for accessing certain services, such as Azure Cognitive Services, Azure Search, or Azure Management APIs. Each service may have its own specific way of using API keys, but the general concept remains the same. The AzureKeyCredential allows you to authenticate using a key.
Code Samples
Create a key credential for a service key.
AzureKeyCredential azureKeyCredential = new AzureKeyCredential("AZURE-SERVICE-KEY");
Constructor Summary
Constructor | Description |
---|---|
AzureKeyCredential(String key) |
Creates a credential that authorizes request with the given key. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Azure |
update(String key)
Rotates the key associated to this credential. |
Methods inherited from KeyCredential
Methods inherited from java.lang.Object
Constructor Details
AzureKeyCredential
public AzureKeyCredential(String key)
Creates a credential that authorizes request with the given key.
Parameters:
Method Details
update
public AzureKeyCredential update(String key)
Rotates the key associated to this credential.
Overrides:
AzureKeyCredential.update(String key)Parameters:
Returns:
AzureKeyCredential
object.Applies to
Azure SDK for Java
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기