Exemple #1
0
        public override AuthenticationInfo Authenticate(AuthToken authToken)
        {
            string principal = authToken.Principal();

            char[] credentials = authToken.Credentials();

            if (principal.Equals("neo4j") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(( AuthenticationInfo )() => "neo4j");
            }
            return(null);
        }
Exemple #2
0
        public override AuthInfo AuthenticateAndAuthorize(AuthToken authToken)
        {
            string principal = authToken.Principal();

            char[] credentials = authToken.Credentials();

            if (principal.Equals("neo4j") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(AuthInfo.of("neo4j", Collections.singleton(PredefinedRoles.READER)));
            }
            return(null);
        }
Exemple #3
0
        public override AuthInfo AuthenticateAndAuthorize(AuthToken authToken)
        {
            GetAuthInfoCallCount.incrementAndGet();

            string principal = authToken.Principal();

            char[] credentials = authToken.Credentials();

            if (principal.Equals("neo4j") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(CacheableAuthInfo.of("neo4j", "neo4j".GetBytes(), Collections.singleton(PredefinedRoles.READER)));
            }
            return(null);
        }
Exemple #4
0
        public override AuthenticationInfo Authenticate(AuthToken authToken)
        {
            GetAuthenticationInfoCallCount.incrementAndGet();

            string principal = authToken.Principal();

            char[] credentials = authToken.Credentials();

            if (principal.Equals("neo4j") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(CacheableAuthenticationInfo.of("neo4j", "neo4j".GetBytes()));
            }
            return(null);
        }
Exemple #5
0
        public override AuthenticationInfo Authenticate(AuthToken authToken)
        {
            GetAuthenticationInfoCallCount.incrementAndGet();

            string principal = authToken.Principal();

            char[] credentials = authToken.Credentials();

            if (principal.Equals("neo4j") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(CustomCacheableAuthenticationInfo.of("neo4j", token =>
                {
                    char[] tokenCredentials = token.credentials();
                    return tokenCredentials.SequenceEqual("neo4j".ToCharArray());
                }));
            }
            return(null);
        }