Examples of AuthenticationContext


Examples of org.eclipse.aether.repository.AuthenticationContext

                    p.setProtocol( proxy.getType() );
                    p.setPort( proxy.getPort() );
                    if ( proxy.getAuthentication() != null )
                    {
                        repo = new RemoteRepository.Builder( repo ).setProxy( proxy ).build();
                        AuthenticationContext authCtx = AuthenticationContext.forProxy( session, repo );
                        p.setUserName( authCtx.get( AuthenticationContext.USERNAME ) );
                        p.setPassword( authCtx.get( AuthenticationContext.PASSWORD ) );
                        p.setNtlmDomain( authCtx.get( AuthenticationContext.NTLM_DOMAIN ) );
                        p.setNtlmHost( authCtx.get( AuthenticationContext.NTLM_WORKSTATION ) );
                        authCtx.close();
                    }
                    return p;
                }
            }
        }
View Full Code Here

Examples of org.eclipse.aether.repository.AuthenticationContext

                RemoteRepository repo = RepositoryUtils.toRepo( repository );
                org.eclipse.aether.repository.Authentication auth = selector.getAuthentication( repo );
                if ( auth != null )
                {
                    repo = new RemoteRepository.Builder( repo ).setAuthentication( auth ).build();
                    AuthenticationContext authCtx = AuthenticationContext.forRepository( session, repo );
                    Authentication result =
                        new Authentication( authCtx.get( AuthenticationContext.USERNAME ),
                                            authCtx.get( AuthenticationContext.PASSWORD ) );
                    result.setPrivateKey( authCtx.get( AuthenticationContext.PRIVATE_KEY_PATH ) );
                    result.setPassphrase( authCtx.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) );
                    authCtx.close();
                    return result;
                }
            }
        }
        return null;
View Full Code Here

Examples of org.eclipse.aether.repository.AuthenticationContext

                    p.setProtocol( proxy.getType() );
                    p.setPort( proxy.getPort() );
                    if ( proxy.getAuthentication() != null )
                    {
                        repo = new RemoteRepository.Builder( repo ).setProxy( proxy ).build();
                        AuthenticationContext authCtx = AuthenticationContext.forProxy( session, repo );
                        p.setUserName( authCtx.get( AuthenticationContext.USERNAME ) );
                        p.setPassword( authCtx.get( AuthenticationContext.PASSWORD ) );
                        p.setNtlmDomain( authCtx.get( AuthenticationContext.NTLM_DOMAIN ) );
                        p.setNtlmHost( authCtx.get( AuthenticationContext.NTLM_WORKSTATION ) );
                        authCtx.close();
                    }
                    return p;
                }
            }
        }
View Full Code Here

Examples of org.eclipse.aether.repository.AuthenticationContext

  private void assertProxySelectorConfiguration(DefaultRepositorySystemSession session,
      RemoteRepository repository) {
    Proxy proxy = session.getProxySelector().getProxy(repository);
    repository = new RemoteRepository.Builder(repository).setProxy(proxy).build();
    AuthenticationContext authenticationContext = AuthenticationContext.forProxy(
        session, repository);
    assertEquals("proxy.example.com", proxy.getHost());
    assertEquals("proxyuser",
        authenticationContext.get(AuthenticationContext.USERNAME));
    assertEquals("somepassword",
        authenticationContext.get(AuthenticationContext.PASSWORD));
  }
View Full Code Here

Examples of org.eclipse.aether.repository.AuthenticationContext

        .getAuthentication(repository);

    repository = new RemoteRepository.Builder(repository).setAuthentication(
        authentication).build();

    AuthenticationContext authenticationContext = AuthenticationContext
        .forRepository(session, repository);

    assertEquals("tester", authenticationContext.get(AuthenticationContext.USERNAME));
    assertEquals("secret", authenticationContext.get(AuthenticationContext.PASSWORD));
  }
View Full Code Here

Examples of org.jboss.errai.bus.client.security.AuthenticationContext

    ErraiBus.get().subscribe("appContext.login", new MessageCallback()
    {     
      public void callback(Message message)
      {
        AuthenticationContext authContext =
            Registry.get(SecurityService.class).getAuthenticationContext();
        String userName = authContext.getName() != "" ?
            authContext.getName() : "Not authenticated";
        username.setText(userName);
        loginDate = new Date();
        layout();
      }
    });
View Full Code Here

Examples of org.jboss.errai.bus.client.security.AuthenticationContext

          public void onClick(ClickEvent clickEvent)
          {           
            String sessionId = Cookies.getCookie("JSESSIONID") != null ?
                            Cookies.getCookie("JSESSIONID") : "";
            AuthenticationContext authContext = Registry.get(SecurityService.class).getAuthenticationContext();
            Set<Role> roleSet = authContext.getRoles();

            StringBuffer roles = new StringBuffer();
            for(Role r : roleSet)
            {
              roles.append(r.getRoleName()).append(" ");
            }

            StringBuffer sb = new StringBuffer("<h3>User information</h3>");
            sb.append("- User: ").append(authContext.getName()).append("<br/>");
            sb.append("- Logged in since: ").append(loginDate).append("<br/>");
            sb.append("- SID: ").append(sessionId).append("<br/>");
            sb.append("- Roles: ").append(roles.toString()).append("<br/>");

View Full Code Here

Examples of org.jboss.errai.bus.client.security.AuthenticationContext

    MessageBuilder.createMessage()
        .toSubject(Workspace.SUBJECT)
        .command(LayoutCommands.Initialize)
        .noErrorHandling().sendNowWith(ErraiBus.get());

    AuthenticationContext authenticationContext = Registry.get(SecurityService.class).getAuthenticationContext();
    String userName = authenticationContext != null ?
        authenticationContext.getName() : "NoAuthentication";

    MessageBuilder.createMessage()
        .toSubject("appContext.login")
        .signalling()
        .with("username", userName)
View Full Code Here

Examples of org.jboss.errai.bus.client.security.AuthenticationContext

    final Tool toolImpl = new ToolImpl(name, toolId, multipleAllowed, img, component);
    ToolProvider provider = new ToolProvider() {
      public Tool getTool() {

        AuthenticationContext authContext =
            Registry.get(SecurityService.class).getAuthenticationContext();

        boolean isAuthorized = false;

        if(authContext!=null)
        {
          Set<Role> roleSet = authContext.getRoles();
          for(Role assignedRole : roleSet)
          {
            for(String s : requiredRoles)
            {
              if(s.equals(assignedRole.getRoleName()))
View Full Code Here

Examples of org.jboss.errai.bus.client.security.AuthenticationContext

        final Tool toolImpl = new ToolImpl(name, toolId, multipleAllowed, img, component);
        ToolProvider provider = new ToolProvider() {
            public Tool getTool() {

                AuthenticationContext authContext =
                        Registry.get(SecurityService.class).getAuthenticationContext();

                boolean isAuthorized = false;

                if (authContext != null) {
                    Set<Role> roleSet = authContext.getRoles();
                    for (Role assignedRole : roleSet) {
                        for (String s : requiredRoles) {
                            if (s.equals(assignedRole.getRoleName()))
                                isAuthorized = true;
                        }
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.