Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NOAUTH Authentication required

Tags:

redis

apache

After i configured redis with password protected i get below error

Exception Occured 
Exception Message --> NOAUTH Authentication required.
Exception Cause --> redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
File Name : SecurityInterceptor.java    
Class Name : org.tcs.com.security.filter.SecurityInterceptor
Method Name : doFilter
like image 483
Suresh Avatar asked May 14 '14 08:05

Suresh


People also ask

What is Noauth Authentication required?

How we fix Redis NOAUTH authentication required error? Usually, this error occurs when the Redis server has a password configured. If we set the requirepass directive, it will cause the server to require password authentication.

How do I authenticate Redis?

When the authorization layer is enabled, Redis will refuse any query by unauthenticated clients. A client can authenticate itself by sending the AUTH command followed by the password. The password is set by the system administrator in clear text inside the redis. conf file.

Can't connect to Redis?

Firewall restriction is another common reason that can trigger the “could not connect to Redis connection refused”. By default Redis server listen to the TCP port 6379. If another application is using the port or if the firewall restrictions blocks the port, it can trigger the connection refused error.

What is default Redis password?

Starting Redis By default, the port is 6379 and there is no password.


2 Answers

redis.clients.jedis.exceptions.JedisDataException

indicates that jedis (a java Redis client) is used to connect with Redis server.

"NOAUTH Authentication required error"

indicates that the jedis connection requires password for authentication.

The following java code snippet shows how the password could be set:

JedisShardInfo shardInfo = new JedisShardInfo(redisHost, redisPort);
shardInfo.setPassword(redisPassword);
Jedis jedis = new Jedis(shardInfo);
jedis.connect();
like image 182
kmarabet Avatar answered Oct 02 '22 01:10

kmarabet


Add your password property to the block in your Tomcat context.xml..

like image 44
Suresh Avatar answered Oct 02 '22 02:10

Suresh