Package com.azure.core.credential
Class BasicAuthenticationCredential
java.lang.Object
com.azure.core.credential.BasicAuthenticationCredential
- All Implemented Interfaces:
TokenCredential
Basic Auth credentials for use with a REST Service Client.
-
Constructor Summary
ConstructorDescriptionBasicAuthenticationCredential
(String username, String password) Creates a basic authentication credential. -
Method Summary
Modifier and TypeMethodDescriptiongetToken
(TokenRequestContext request) Asynchronously get a token for a given resource/audience.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.core.credential.TokenCredential
getTokenSync
-
Constructor Details
-
BasicAuthenticationCredential
Creates a basic authentication credential.- Parameters:
username
- basic auth user namepassword
- basic auth password
-
-
Method Details
-
getToken
Description copied from interface:TokenCredential
Asynchronously get a token for a given resource/audience. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.- Specified by:
getToken
in interfaceTokenCredential
- Parameters:
request
- the details of the token request- Returns:
- a Publisher that emits a single access token
- Throws:
RuntimeException
- If the UTF-8 encoding isn't supported.
-