Tabnine Logo
ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair
Code IndexAdd Tabnine to your IDE (free)

How to use
loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair
method
in
org.jclouds.cloudstack.util.ApiKeyPairs

Best Java code snippets using org.jclouds.cloudstack.util.ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair (Showing top 4 results out of 315)

origin: jclouds/legacy-jclouds

@Test(expectedExceptions = AuthorizationException.class)
public void testTryToGetApiKeypairWithWrongCredentials() {
 ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
   URI.create(endpoint), "dummy-missing-user", "with-a-wrong-password", "");
}
origin: apache/jclouds

@Test(expectedExceptions = AuthorizationException.class)
public void testTryToGetApiKeypairWithWrongCredentials() {
 ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
   URI.create(endpoint), "dummy-missing-user", "with-a-wrong-password", "");
}
origin: jclouds/legacy-jclouds

@Test
public void testCreateContextUsingUserAndPasswordAuthentication() {
 skipIfNotGlobalAdmin();
 Account testAccount = null;
 User testUser = null;
 String prefix = this.prefix + "-session";
 try {
   testAccount = createTestAccount(globalAdminClient, prefix);
   testUser = createTestUser(globalAdminClient, testAccount, prefix);
   String expectedUsername = prefix + "-user";
   assertEquals(testUser.getName(), expectedUsername);
   checkLoginAsTheNewUser(expectedUsername);
   ApiKeyPair expected = globalAdminClient.getUserClient().registerUserKeys(testUser.getId());
   ApiKeyPair actual = ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
    URI.create(endpoint), prefix + "-user", "password", "");
   assertEquals(actual, expected);
 } finally {
   if (testUser != null)
    globalAdminClient.getUserClient().deleteUser(testUser.getId());
   if (testAccount != null)
    globalAdminClient.getAccountClient().deleteAccount(testAccount.getId());
 }
}
origin: apache/jclouds

@Test
public void testCreateContextUsingUserAndPasswordAuthentication() {
 skipIfNotGlobalAdmin();
 Account testAccount = null;
 User testUser = null;
 String prefix = this.prefix + "-session";
 try {
   testAccount = createTestAccount(globalAdminClient, prefix);
   testUser = createTestUser(globalAdminClient, testAccount, prefix);
   String expectedUsername = prefix + "-user";
   assertEquals(testUser.getName(), expectedUsername);
   checkLoginAsTheNewUser(expectedUsername);
   ApiKeyPair expected = globalAdminClient.getUserClient().registerUserKeys(testUser.getId());
   ApiKeyPair actual = ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
    URI.create(endpoint), prefix + "-user", "password", "");
   assertEquals(actual, expected);
 } finally {
   if (testUser != null)
    globalAdminClient.getUserClient().deleteUser(testUser.getId());
   if (testAccount != null)
    globalAdminClient.getAccountApi().deleteAccount(testAccount.getId());
 }
}
org.jclouds.cloudstack.utilApiKeyPairsloginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair

Javadoc

Retrieve the API key pair for a given CloudStack user

Popular methods of ApiKeyPairs

    Popular in Java

    • Making http post requests using okhttp
    • onCreateOptionsMenu (Activity)
    • onRequestPermissionsResult (Fragment)
    • getSupportFragmentManager (FragmentActivity)
    • File (java.io)
      An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
    • IOException (java.io)
      Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
    • Charset (java.nio.charset)
      A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
    • SQLException (java.sql)
      An exception that indicates a failed JDBC operation. It provides the following information about pro
    • Executor (java.util.concurrent)
      An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
    • ThreadPoolExecutor (java.util.concurrent)
      An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
    • Top 17 Plugins for Android Studio
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now