Search in sources :

Example 1 with ServicePrincipalLoginDialog

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;
}
Also used : SignInDialog(com.microsoft.azuretools.core.ui.SignInDialog) AuthConfiguration(com.microsoft.azure.toolkit.lib.auth.model.AuthConfiguration) ServicePrincipalLoginDialog(com.microsoft.azuretools.core.ui.ServicePrincipalLoginDialog)

Aggregations

AuthConfiguration (com.microsoft.azure.toolkit.lib.auth.model.AuthConfiguration)1 ServicePrincipalLoginDialog (com.microsoft.azuretools.core.ui.ServicePrincipalLoginDialog)1 SignInDialog (com.microsoft.azuretools.core.ui.SignInDialog)1