Search in sources :

Example 1 with SignInWindow

use of com.microsoft.intellij.ui.SignInWindow in project azure-tools-for-java by Microsoft.

the class AzureSignInAction method showSignInWindowAndGetAuthConfiguration.

private static AuthConfiguration showSignInWindowAndGetAuthConfiguration(Project project) throws InterruptedException {
    final SignInWindow dialog = new SignInWindow(new AuthMethodDetails(), project);
    if (!dialog.showAndGet()) {
        throw new InterruptedException("user cancel");
    }
    AuthConfiguration auth = new AuthConfiguration();
    AuthType type = dialog.getData();
    auth.setType(type);
    if (type == AuthType.SERVICE_PRINCIPAL) {
        final ServicePrincipalLoginDialog spDialog = new ServicePrincipalLoginDialog(project);
        if (!spDialog.showAndGet()) {
            throw new InterruptedException("user cancel");
        }
        auth = spDialog.getData();
    }
    return auth;
}
Also used : AuthMethodDetails(com.microsoft.azuretools.authmanage.models.AuthMethodDetails) AuthConfiguration(com.microsoft.azure.toolkit.lib.auth.model.AuthConfiguration) ServicePrincipalLoginDialog(com.microsoft.intellij.ui.ServicePrincipalLoginDialog) AuthType(com.microsoft.azure.toolkit.lib.auth.model.AuthType) SignInWindow(com.microsoft.intellij.ui.SignInWindow)

Aggregations

AuthConfiguration (com.microsoft.azure.toolkit.lib.auth.model.AuthConfiguration)1 AuthType (com.microsoft.azure.toolkit.lib.auth.model.AuthType)1 AuthMethodDetails (com.microsoft.azuretools.authmanage.models.AuthMethodDetails)1 ServicePrincipalLoginDialog (com.microsoft.intellij.ui.ServicePrincipalLoginDialog)1 SignInWindow (com.microsoft.intellij.ui.SignInWindow)1