use of com.microsoft.azuretools.core.ui.ServicePrincipalLoginDialog in project azure-tools-for-java by Microsoft.
the class SignInCommandHandler method showSignInWindowAndGetAuthConfiguration.
private static AuthConfiguration showSignInWindowAndGetAuthConfiguration(Shell parentShell) throws InterruptedException {
final SignInDialog dialog = new SignInDialog(parentShell);
dialog.create();
if (dialog.open() != Window.OK) {
throw new InterruptedException("user cancel");
}
AuthConfiguration auth = dialog.getData();
if (auth.getType() == AuthType.SERVICE_PRINCIPAL) {
ServicePrincipalLoginDialog servicePrincipalLoginDialog = new ServicePrincipalLoginDialog(parentShell);
if (servicePrincipalLoginDialog.open() == Window.CANCEL) {
throw new InterruptedException("user cancel");
}
auth = servicePrincipalLoginDialog.getModel();
}
return auth;
}
Aggregations