Examples of AuthenticationContext


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")
        .with("username", userName)
        .noErrorHandling()
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.openengsb.core.api.security.AuthenticationContext

    private CommitConverter converter;

    @Before
    public void setUp() throws Exception {
        // mock auth context
        AuthenticationContext authenticationContext = mock(AuthenticationContext.class);
        when(authenticationContext.getAuthenticatedPrincipal()).thenReturn("testUser");

        // mock context
        ContextHolder contextHolder = ContextHolder.get();
        contextHolder.setCurrentContextId("testContext");
View Full Code Here

Examples of org.openengsb.core.api.security.AuthenticationContext

    protected static final String COMMITTER = "testuser";
    protected static final String CONTEXT = "testcontext";

    @Before
    public void initDB() throws Exception {
        AuthenticationContext authenticationContext = mock(AuthenticationContext.class);
        when(authenticationContext.getAuthenticatedPrincipal()).thenReturn(COMMITTER);
        EntityManager em = testPersistenceUnit.getEntityManager("edb");
        JPADao dao = new DefaultJPADao(em);
        EDBPreCommitHook preCommitHook = new CheckPreCommitHook(dao);
        ContextHolder.get().setCurrentContextId(CONTEXT);
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.