Package com.azure.identity
Class SharedTokenCacheCredential
java.lang.Object
com.azure.identity.SharedTokenCacheCredential
- All Implemented Interfaces:
com.azure.core.credential.TokenCredential
public class SharedTokenCacheCredential
extends Object
implements com.azure.core.credential.TokenCredential
A credential provider that provides token credentials from the MSAL shared token cache.
Requires a username and client ID. If a username is not provided, then the
AZURE_USERNAME
environment variable will be used.
This credential is a legacy mechanism for authenticating clients using credentials provided to Visual Studio Code.
This mechanism for Visual Studio authentication has been replaced by the VisualStudioCodeCredential
/>.
- See Also:
-
Method Details
-
getToken
public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request) Gets token from shared token cache- Specified by:
getToken
in interfacecom.azure.core.credential.TokenCredential
- Parameters:
request
- the details of the token request- Returns:
- a Publisher that emits a single access token
-