import { TokenCredentialsBase } from "./tokenCredentialsBase" ; import { Environment } from "@azure/ms-rest-azure-env" ; import { AuthConstants , TokenAudience } from "../util/authConstants" ; import { TokenResponse , TokenCache } from "adal-node" ; export class DeviceTokenCredentials extends TokenCredentialsBase { readonly username : string ; param clientId param domain param username param tokenAudience - The audience for which the token is requested. Valid values are 'graph', 'batch', or any other resource like 'https://vault.azure.net/'.
     * If tokenAudience is 'graph' then domain should also be provided and its value should not be the default 'common' tenant. It must be a string (preferrably in a guid format).
     * See  https * for an example.
     *  param environment param tokenCache public constructor ( clientId ? , domain ? , username ? , tokenAudience ? , environment ? , tokenCache ? ) { if ( ! username ) { username = "user@example.com" ; } if ( ! domain ) { domain = AuthConstants . AAD_COMMON_TENANT ; } if ( ! clientId ) { clientId = AuthConstants . DEFAULT_ADAL_CLIENT_ID ; } super ( clientId , domain , tokenAudience , environment , tokenCache ) ; this . username = username ; } public getToken ( ) { return this . getTokenFromCache ( this . username ) ; } }