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

Redis ACL (user/pass) support? #63

Closed
LangJV opened this issue Feb 29, 2024 · 3 comments
Closed

Redis ACL (user/pass) support? #63

LangJV opened this issue Feb 29, 2024 · 3 comments

Comments

@LangJV
Copy link

LangJV commented Feb 29, 2024

Is it currently possible to utilize a redis username AND password when authenticating to Redis?

The documentation mentions the ability to pass a password, but quite a few years back REdis becan supporting true ACLs, meaning you can now authenticate with a username AND a password.

I'd like to know if i pass like: "OAuth2username" or "username" or "OAuth2redisusername" - will it be able to authenticate with a username and password?

@zandbelt
Copy link
Member

apparently it isn't but it wouldn't take much to add it in a new release of liboauth2

zandbelt added a commit to OpenIDC/liboauth2 that referenced this issue Mar 4, 2024
@LangJV
Copy link
Author

LangJV commented Mar 5, 2024

As a follow-up question (and apoloiges if this is super basic) - how does one provide any of the redis arguments:
Looking at:

mod_oauth2/oauth2.conf

Lines 27 to 57 in aa178d4

# OAuth2Cache Options:
#
# <name> <value> (default) <description>
#
# generic:
#
# name <string> (default) the name of the (named) cache to refer to from e.g. OAuth2TokenVerify
# key_hash_algo <string> (sha256) hash algorithm for the cache key (or "none")
# encrypt true|false (true) encrypt the cache value (default is "false" for the shm cache backend)
# passphrase_hash_algo <string> (sha256) hash algorithm to apply to the passphrase before using it as an encryption key
#
# shm:
#
# max_key_size <number> (65) maximum size of the cache key in bytes (see also: key_hash_algo)
# max_val_size <number> (8193) maximum size of a single cache value
# max_entries <number> (1000) maximum number of entries in the cache (FIFO policy, overruns will result in a warning in the log)
#
# file:
#
# dir <path> (/tmp or C:\\Temp) cache file directory
# clean_interval <seconds> (60) minimum interval to loop over the cache directories looking to delete expired entries
#
# memcache:
#
# config_string <string> (--SERVER=localhost) memcached specific server configuration string, see: https://www.systutorials.com/docs/linux/man/3-memcached/
#
# redis:
#
# host <string> (localhost) Redis server hostname
# port <number> (6379) Redis servver port
# password <string> (<no authentication>) password used to authenticate to the Redis server

would i do something like:
OAuth2Cache redis host myhost port 1234 password mypassword

Or:
OAuth2Cache redis
OAuth2Cache host myhost
OAuth2Cache port 1234
OAuth2Cache password mypassword

Or:
OAuth2Cache redis host myhost
OAuth2Cache redis port 1234
OAuth2Cache redis password mypassword

I've tried googling but the internet doesnt seem to have examples either. I see the doc defines the syntax as: #OAuth2Cache []
But that seems a bit ambiguous (maybe just to me?)

@zandbelt
Copy link
Member

zandbelt commented Mar 5, 2024

it is a query-encoded format, as documented - with samples - in:

mod_oauth2/oauth2.conf

Lines 68 to 73 in aa178d4

#OAuth2TokenVerify <type> <value> [<options-in-query-encoded-format>]
#
# Samples:
#
# OAuth2TokenVerify introspect https://pingfed:9031/as/introspect.oauth2 introspect.ssl_verify=false&introspect.auth=client_secret_basic&client_id=rs0&client_secret=2Federate
# OAuth2TokenVerify jwks_uri https://pingfed:9031/ext/one jwks_uri.ssl_verify=false

I notice that since the order of the statements in the sample changed (OAuth2Cache needs to be specified before others), this is less than obvious now, I'll improve that
so OAuth2Cache redis host=myhost&port=1234&password=mypassword
there are also a few examples in the README.md which is probably what most people go with

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

2 participants