Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing password parameter in the connection #44

Open
aztrock opened this issue Mar 30, 2015 · 5 comments
Open

missing password parameter in the connection #44

aztrock opened this issue Mar 30, 2015 · 5 comments

Comments

@aztrock
Copy link

aztrock commented Mar 30, 2015

No description provided.

@summershrimp
Copy link

you can use client:auth(password)

@aztrock
Copy link
Author

aztrock commented Dec 13, 2015

redis = require 'redis'
client = redis.connect('127.0.0.1', 6379)
client.auth(password)
/usr/local/share/lua/5.1/redis.lua:371: attempt to index field 'network' (a nil value)
stack traceback:
/usr/local/share/lua/5.1/redis.lua:371: in function 'send'
/usr/local/share/lua/5.1/redis.lua:379: in function 'auth'
stdin:1: in main chunk
[C]: ?

@summershrimp
Copy link

client:auth, not client.auth

@mosjin
Copy link

mosjin commented Feb 21, 2019

client:auth( password ) works for me, thanks a lot!

@joaomateusferr
Copy link

joaomateusferr commented Feb 26, 2023

Hey guys, there are a few different ways to authenticate with redis lua and the method shown above is just one of them.

When we configure redis to require a password by changing the redis.conf file and uncommenting the requirepass flag (# requirepass foobared) we use the auth method as below.

redis = require 'redis'
local password = 'mypass'
client = redis.connect('127.0.0.1', 6379)
client:auth(password)

However, if we use the acl with a username and password, we must authenticate as follows.

redis = require 'redis'
local password = 'mypass'
local user = 'myuser'
client = redis.connect('127.0.0.1', 6379)
client:auth(user, password)

I left some links to help if anyone is facing the same difficulties I went through

https://redis.io/commands/auth/
https://redis.io/docs/management/security/acl/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants