示例#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.of("neo4j"));
            }
            else if (principal.Equals("authorization_expired_user") && Arrays.Equals(credentials, "neo4j".ToCharArray()))
            {
                return(( AuthenticationInfo )() => "authorization_expired_user");
            }
            return(null);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateCorrectAuthenticationInfo()
        public virtual void ShouldCreateCorrectAuthenticationInfo()
        {
            PluginAuthenticationInfo internalAuthInfo = PluginAuthenticationInfo.CreateCacheable(AuthenticationInfo.of("thePrincipal"), "theRealm", null);

            assertThat((IList <string>)internalAuthInfo.Principals.asList(), containsInAnyOrder("thePrincipal"));
        }