Package org.jboss.errai.bus.client.security

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


          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

    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

    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

        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

    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")
        .with("username", userName)
        .noErrorHandling()
View Full Code Here

    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

          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

TOP

Related Classes of org.jboss.errai.bus.client.security.AuthenticationContext

Copyright © 2018 www.massapicom. 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.