Package io.fathom.cloud.protobuf.IdentityModel

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


    @Override
    @Transactional
    public AuthenticatedUser authenticate(Long projectId, ClientCertificate clientCertificate, ByteString challenge,
            ByteString response) throws CloudException {
        DomainData domain = identityService.getDefaultDomain();
        UserWithSecret userWithSecret = authenticate(domain, clientCertificate, challenge, response);
        if (userWithSecret == null) {
            return null;
        }
View Full Code Here


    }

    @Override
    @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;
        }
View Full Code Here

        UserData granteeData = authRepository.getUsers().find(granteeUserId);
        if (granteeData == null) {
            throw new IllegalArgumentException();
        }

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

        UserData.Builder b = UserData.newBuilder(granteeData);
View Full Code Here

        return ret;
    }

    @Override
    public DomainData findDomain(UserData user, String id) throws CloudException {
        DomainData domain = authRepository.getDomains().find(Long.valueOf(id));

        // TODO: Other domains?
        if (domain != null && domain.getId() != user.getDomainId()) {
            domain = null;
        }

        return domain;
    }
View Full Code Here

        return ret;
    }

    @Override
    public UserData findUserByName(long domainId, String userName) throws CloudException {
        DomainData domain = authRepository.getDomains().find(domainId);
        if (domain == null) {
            throw new IllegalArgumentException();
        }

        CredentialData credentialData = authRepository.getUsernames(domain).find(userName);
View Full Code Here

    protected DomainData findDefaultDomain() throws CloudException {
        return find(DEFAULT_DOMAIN_ID);
    }

    public DomainData getDefaultDomain() throws CloudException {
        DomainData domain = findDefaultDomain();
        if (domain == null) {
            throw new IllegalStateException();
        }
        return domain;
    }
View Full Code Here

            RegisterResponse response = new RegisterResponse();
            response.challenge = BaseEncoding.base64().encode(challenge.toByteArray());
            return response;
        }

        DomainData domain = identityService.getDefaultDomain();

        UserData.Builder b = UserData.newBuilder();

        // We allow multiple systems to share an email address
        // so we use the public key hash as our unique id
        {
            ByteString publicKeySha1 = clientCertificate.getPublicKeySha1();
            String hex = BaseEncoding.base16().encode(publicKeySha1.toByteArray());
            b.setName("__pubkey__" + hex);
        }

        b.setDomainId(domain.getId());

        b.setEnabled(true);

        b.setEmail(request.email);
View Full Code Here

TOP

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

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.