Examples of AuthenticationResponse


Examples of ch.iterate.openstack.swift.AuthenticationResponse

                            regions.add(new Region(regionId, URI.create(publicUrl), cdnUrl == null ? null : URI.create(cdnUrl),
                                    regionId.equals(defaultRegion)));
                        }
                    }
                }
                return new AuthenticationResponse(response, token, regions);
            }
            catch(JsonParseException e) {
                throw new IOException(e.getMessage(), e);
            }
        }
View Full Code Here

Examples of ch.iterate.openstack.swift.AuthenticationResponse

                    String cdnUrl = cdnUrls.containsKey(regionId) ? cdnUrls.get(regionId) : null;
                    Boolean v1Default = cloudFiles.get("v1Default") != null
                            ? cloudFiles.get("v1Default").getAsBoolean() : Boolean.FALSE;
                    regions.add(new Region(regionId, URI.create(publicUrl), cdnUrl == null ? null : URI.create(cdnUrl), v1Default));
                }
                return new AuthenticationResponse(response, token, regions);
            }
            catch(JsonParseException e) {
                throw new IOException(e.getMessage(), e);
            }
        }
View Full Code Here

Examples of com.atlauncher.data.mojang.auth.AuthenticationResponse

            reader.close();
        } catch (IOException e) {
            App.settings.logStackTrace(e);
            return null;
        }
        AuthenticationResponse result = null;
        if (response != null) {
            try {
                result = gson.fromJson(response.toString(), AuthenticationResponse.class);
            } catch (JsonSyntaxException e) {
                App.settings.logStackTrace(e);
            }
            if (result != null) {
                result.setUUID(UUID.randomUUID().toString());
            }
        }
        return result;
    }
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

   * @throws RepositoryException
   */
  public void testInvalidUser() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity("not a real username"));
    assertFalse(response.isValid());
  }
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

   * @throws RepositoryException
   */
  public void testValidUser() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity(username, password));
    assertTrue("Failed to authenticate: " + username, response.isValid());
    @SuppressWarnings({ "unchecked", "cast" })
        Collection<Principal> groups = (Collection<Principal>) response.getGroups();
    if (groups != null) {
      String groupPrefix = ((NotesConnectorSession) session)
          .getGsaGroupPrefix();
      for (Principal group : groups) {
        String name = group.getName();
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

   * @throws RepositoryException
   */
  public void testValidUserGroupResolutionOnly() throws RepositoryException {
    Session session = connector.login();
    AuthenticationManager manager = session.getAuthenticationManager();
    AuthenticationResponse response = manager.authenticate(
        new SimpleAuthenticationIdentity(username, null));
    assertTrue("Authenticated: " + username, response.isValid());
    @SuppressWarnings({ "unchecked", "cast" })
        Collection<Principal> groups = (Collection<Principal>) response.getGroups();
    if (groups != null) {
      String groupPrefix = ((NotesConnectorSession) session)
          .getGsaGroupPrefix();
      for (Principal group : groups) {
        String name = group.getName();
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

  public void testAuthenticateKnownUser() throws Exception {
    // Validate the first name in the list
    String user = names[0];
    NotesNameMock nameMock = notesNamesCache.get(user);
    AuthenticationResponse response = authenticationManager.authenticate(
        new SimpleAuthenticationIdentity(nameMock.getShortName(),"password"));
    assertTrue(user + " is valid: ", response.isValid());
    testUserGroups(connectorSession, response, user);
  }
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

      super.tearDown();
    }
  }

  public void testAuthenticateUnknownUser() throws Exception {
    AuthenticationResponse response = authenticationManager
        .authenticate(new SimpleAuthenticationIdentity("foo"));
    assertFalse(response.isValid());
  }
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

        .authenticate(new SimpleAuthenticationIdentity("foo"));
    assertFalse(response.isValid());
  }

  public void testAuthenticateKnownUserNoPassword() throws Exception {
    AuthenticationResponse response = authenticationManager
        .authenticate(new SimpleAuthenticationIdentity("anakin"));
    assertTrue("known user not valid", response.isValid());
    verifyGroups(connectorSession, response);
  }
View Full Code Here

Examples of com.google.enterprise.connector.spi.AuthenticationResponse

    assertTrue("known user not valid", response.isValid());
    verifyGroups(connectorSession, response);
  }

  public void testAuthenticateKnownUserBadPassword() throws Exception {
    AuthenticationResponse response = authenticationManager
        .authenticate(new SimpleAuthenticationIdentity("anakin", "foo"));
    assertFalse("valid with bad password", response.isValid());
    verifyGroups(connectorSession, response);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.