Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async login() {
try {
const authResponse = await msRestNodeAuth.loginWithServicePrincipalSecretWithAuthResponse(this.clientId, this.clientSecret, this.tenantId);
this.credentials = authResponse.credentials
} catch (err) {
console.log(err);
}
}
public async servicePrincipalLogin(clientId: string, secret: string, tenantId: string, options: AzureTokenCredentialsOptions): Promise {
return await loginWithServicePrincipalSecretWithAuthResponse(clientId, secret, tenantId, options);
}
}
}
if (TENANT_ID) {
logger.info(`Using TENANT_ID=${TENANT_ID}`);
} else {
throw new Error('TENANT_ID is required in CI mode');
}
if (AZURE_SUBSCRIPTION_ID) {
logger.info(`Using AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID}`);
} else {
throw new Error('AZURE_SUBSCRIPTION_ID is required in CI mode');
}
logger.info(`Configuration OK`);
auth = await loginWithServicePrincipalSecretWithAuthResponse(CLIENT_ID, CLIENT_SECRET, TENANT_ID);
globalConfig.set(AUTH, auth);
return auth;
}