Examples of Authentication


Examples of org.openengsb.core.api.security.model.Authentication

                userManager.createUser("test");
                userManager.setUserCredentials("test", "password", "password");
                return null;
            }
        });
        Authentication authenticate = authenticator.authenticate("test", new Password("password"));
        assertThat(authenticate, not(nullValue()));
    }
View Full Code Here

Examples of org.sonar.wsclient.services.Authentication

import static org.fest.assertions.Fail.fail;

public class AuthenticationUnmarshallerTest extends UnmarshallerTestCase {
  @Test
  public void should_unmarshall_valid_authentication() {
    Authentication authentication = new AuthenticationUnmarshaller().toModel(loadFile("/authentication/authentication_valid.json"));

    assertThat(authentication.isValid()).isTrue();
  }
View Full Code Here

Examples of org.sonatype.aether.repository.Authentication

        session.setMirrorSelector( mirrorSelector );

        DefaultProxySelector proxySelector = new DefaultProxySelector();
        for ( Proxy proxy : decrypted.getProxies() )
        {
            Authentication proxyAuth = new Authentication( proxy.getUsername(), proxy.getPassword() );
            proxySelector.add( new org.sonatype.aether.repository.Proxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(),
                                                                proxyAuth ), proxy.getNonProxyHosts() );
        }
        session.setProxySelector( proxySelector );

        DefaultAuthenticationSelector authSelector = new DefaultAuthenticationSelector();
        for ( Server server : decrypted.getServers() )
        {
            Authentication auth =
                new Authentication( server.getUsername(), server.getPassword(), server.getPrivateKey(),
                                    server.getPassphrase() );
            authSelector.add( server.getId(), auth );

            if ( server.getConfiguration() != null )
            {
View Full Code Here

Examples of org.springframework.security.Authentication

     */
    public User getActiveUser() {
        HttpServletRequest request = RequestUtils.getActiveRequest();
        User user = (User) WebUtils.getSessionAttribute(request, SESSION_USER);
        if (user instanceof UserImpl) return user;
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        if (auth != null) {
            if (auth.getPrincipal() instanceof UserDetails) {
                user = securityDAO.findUser(((UserDetails) auth.getPrincipal()).getUsername());
                WebUtils.setSessionAttribute(request, SESSION_USER, user);
                return user;
            }
        }
        if (user == null) {
View Full Code Here

Examples of org.springframework.security.Authentication

    }

    protected User getUser(HttpServletRequest request) {
        User user = (User) WebUtils.getSessionAttribute(request, SESSION_USER);
        if (user instanceof GuestUser) {
            Authentication auth = SecurityContextHolder.getContext().getAuthentication();
            if ((auth != null) && (auth.getPrincipal() instanceof UserDetails)) {
                user = securityDAO.findUser(((UserDetails) auth.getPrincipal()).getUsername());
                if (logger.isDebugEnabled()) logger.debug("Setting domain user [" + user.getName() + "] in session");
                WebUtils.setSessionAttribute(request, SESSION_USER, user);
                return user;
            }
        }
View Full Code Here

Examples of org.springframework.security.core.Authentication

        return user;
    }

    @Override
    public User getAuthenticatedUser() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        if (authentication != null && authentication.getPrincipal() instanceof User) {
            return (User) authentication.getPrincipal();
        } else {
            throw new SecurityException("Could not get the authenticated user!");
        }
    }
View Full Code Here

Examples of org.thechiselgroup.choosel.workbench.client.authentication.Authentication

            logoutURL = userService.createLogoutURL(redirectURL);
        } else {
            loginURL = userService.createLoginURL(redirectURL);
        }

        return new Authentication(email, isSignedIn, loginURL, logoutURL);
    }
View Full Code Here

Examples of org.wso2.xkms2.Authentication

        try {

            RecoverRequest request = createRecoverRequest();
            request.setServiceURI(serverURL);

            Authentication authentication = new Authentication();
            Key authenKey = XKMSKeyUtil.getAuthenticationKey(passPhrase);
            authentication.setKeyBindingAuthenticationKey(authenKey);
            request.setAuthentication(authentication);

            RecoverKeyBinding keyBinding = createRecoverKeyBinding();
            keyBinding.setKeyName(alias);
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.