use of com.microsoft.azure.management.Azure.Authenticated in project azure-gradle-plugins by lenala.
the class AzureAuthHelper method getAuthObjFromConfiguration.
/**
* Get Authenticated object by reading app token credentials from gradle.properties
*
* @return Authenticated object if configurations are correct; otherwise return null.
*/
protected Authenticated getAuthObjFromConfiguration(final AuthConfiguration config) {
final ApplicationTokenCredentials credential = getAppTokenCredentials();
if (credential == null) {
return null;
}
final Authenticated auth = azureConfigure().authenticate(credential);
if (auth != null) {
logger.quiet(AUTH_WITH_CLIENT_ID + config.getAuthenticationSetting(CLIENT_ID));
}
return auth;
}
use of com.microsoft.azure.management.Azure.Authenticated in project azure-gradle-plugins by lenala.
the class AzureAuthHelper method getAuthObj.
protected Authenticated getAuthObj() {
Authenticated auth;
// check if project has Azure authentication settings in build.gradle or gradle.properties
boolean hasAuthSetting = config.hasAuthenticationSettings();
if (hasAuthSetting) {
auth = getAuthObjFromConfiguration(config);
if (auth == null) {
auth = getAuthObjFromFile(new File(config.getAuthFile()));
}
} else {
auth = getAuthObjFromAzureCli();
}
return auth;
}
use of com.microsoft.azure.management.Azure.Authenticated in project azure-gradle-plugins by lenala.
the class AzureAuthHelper method getAuthObjFromConfiguration.
/**
* Get Authenticated object by reading app token credentials from gradle.properties
*
* @return Authenticated object if configurations are correct; otherwise return null.
*/
private Authenticated getAuthObjFromConfiguration(final AuthConfiguration config) {
final ApplicationTokenCredentials credential = getAppTokenCredentials();
if (credential == null) {
return null;
}
final Authenticated auth = azureConfigure().authenticate(credential);
if (auth != null) {
logger.quiet(AUTH_WITH_CLIENT_ID + config.getAuthenticationSetting(CLIENT_ID));
}
return auth;
}
use of com.microsoft.azure.management.Azure.Authenticated in project azure-gradle-plugins by lenala.
the class AzureAuthHelper method getAuthObj.
private Authenticated getAuthObj() {
Authenticated auth;
// check if project has Azure authentication settings in build.gradle or gradle.properties
boolean hasAuthSetting = config.hasAuthenticationSettings();
if (hasAuthSetting) {
auth = getAuthObjFromConfiguration(config);
if (auth == null) {
auth = getAuthObjFromFile(new File(config.getAuthFile()));
}
} else {
auth = getAuthObjFromAzureCli();
}
return auth;
}
Aggregations