use of com.microsoft.azuretools.core.ui.SignInDialog in project azure-tools-for-java by Microsoft.
the class SignInCommandHandler method doSignIn.
public static boolean doSignIn(Shell shell) {
try {
AuthMethodManager authMethodManager = AuthMethodManager.getInstance();
boolean isSignIn = authMethodManager.isSignedIn();
if (isSignIn)
return true;
SignInDialog d = SignInDialog.go(shell, authMethodManager.getAuthMethodDetails());
if (null != d) {
AuthMethodDetails authMethodDetailsUpdated = d.getAuthMethodDetails();
authMethodManager.setAuthMethodDetails(authMethodDetailsUpdated);
SelectSubsriptionsCommandHandler.onSelectSubscriptions(shell);
authMethodManager.notifySignInEventListener();
}
return authMethodManager.isSignedIn();
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
Aggregations