Package io.fathom.cloud.protobuf.IdentityModel

Examples of io.fathom.cloud.protobuf.IdentityModel.CredentialData


            b.setPadding(ByteString.copyFrom(r));

            accessId = Hex.toHex(b.build().toByteArray());
        }

        CredentialData created;

        {
            CredentialData.Builder b = CredentialData.newBuilder();
            b.setUserId(forUser.getId());
            b.setProjectId(projectId);
View Full Code Here


        if (Strings.isNullOrEmpty(password)) {
            return null;
        }

        CredentialData credential = authRepository.getUsernames(domain).find(username);
        if (credential == null) {
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            return null;
        }

        UserWithSecret userWithSecret = secretService.checkPassword(user, credential, password);
View Full Code Here

        if (Strings.isNullOrEmpty(password)) {
            throw new IllegalArgumentException();
        }

        CredentialData credential = authRepository.getUsernames(domain).find(username);
        if (credential == null) {
            throw new IllegalArgumentException();
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            throw new IllegalArgumentException();
        }

        secretService.changePassword(user, credential, password, recoveryKey);
View Full Code Here

    @Transactional
    public ByteString getChallenge(ClientCertificate clientCertificate) throws CloudException {
        DomainData domain = identityService.getDefaultDomain();

        String keyId = toCredentialKey(clientCertificate.getPublicKeySha1());
        CredentialData credential = authRepository.getPublicKeyCredentials(domain.getId()).find(keyId);
        if (credential == null) {
            log.info("No credential found for {}", keyId);
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            log.warn("User not found for credential {}", credential);
            return null;
        }
View Full Code Here

    }

    private UserWithSecret authenticate(DomainData domain, ClientCertificate clientCertificate, ByteString challenge,
            ByteString response) throws CloudException {
        String keyId = toCredentialKey(clientCertificate.getPublicKeySha1());
        CredentialData credential = authRepository.getPublicKeyCredentials(domain.getId()).find(keyId);
        if (credential == null) {
            return null;
        }

        UserData user = authRepository.getUsers().find(credential.getUserId());
        if (user == null) {
            return null;
        }

        UserWithSecret userWithSecret = secretService.checkPublicKey(user, credential, clientCertificate, challenge,
View Full Code Here

            request.password = null;
        }

        NamedItemCollection<CredentialData> usernameStore = authRepository.getUsernames(request.domain);

        CredentialData credential = usernameStore.find(username);
        if (credential != null) {
            throw new WebApplicationException(Status.CONFLICT);
        }

        if (challengeKey != null) {
            CredentialData publicKeyCredential = authRepository.getPublicKeyCredentials(request.domain.getId()).find(
                    challengeKey);
            if (publicKeyCredential != null) {
                throw new WebApplicationException(Status.CONFLICT);
            }
        }
View Full Code Here

        DomainData domain = authRepository.getDomains().find(domainId);
        if (domain == null) {
            throw new IllegalArgumentException();
        }

        CredentialData credentialData = authRepository.getUsernames(domain).find(userName);
        if (credentialData == null) {
            return null;
        }

        long userId = credentialData.getUserId();
        UserData user = authRepository.getUsers().find(userId);

        if (user == null) {
            // Unexpected!
            log.warn("Unable to find user for credential: {}", userName);
View Full Code Here

TOP

Related Classes of io.fathom.cloud.protobuf.IdentityModel.CredentialData

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.