use of com.azure.identity.DeviceCodeInfo in project azure-gradle-plugins by microsoft.
the class GradleAuthHelper method handleDeviceCodeAccount.
private static Account handleDeviceCodeAccount(Account account) {
if (account instanceof DeviceCodeAccount) {
final DeviceCodeAccount deviceCodeAccount = (DeviceCodeAccount) account;
final DeviceCodeInfo challenge = deviceCodeAccount.getDeviceCode();
AzureMessager.getMessager().info(AzureString.format(StringUtils.replace(challenge.getMessage(), challenge.getUserCode(), "%s"), challenge.getUserCode()));
}
return account.continueLogin().block();
}
use of com.azure.identity.DeviceCodeInfo in project azure-maven-plugins by microsoft.
the class AbstractAzureMojo method handleDeviceCodeAccount.
private static Account handleDeviceCodeAccount(Account account) {
if (account instanceof DeviceCodeAccount) {
final DeviceCodeAccount deviceCodeAccount = (DeviceCodeAccount) account;
final DeviceCodeInfo challenge = deviceCodeAccount.getDeviceCode();
System.out.println(StringUtils.replace(challenge.getMessage(), challenge.getUserCode(), TextUtils.cyan(challenge.getUserCode())));
}
return account.continueLogin().block();
}
Aggregations