Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Using memcache-client or dalli with the memcache store #8

monocle opened this Issue · 5 comments

5 participants


In OpenID::Store::Memcache#use_nonce, the return value of #use_nonce is based on a regex search for 'STORED' on the result of @cache_client.add(). However when using memcache-client or dalli for the cache client, the return value of #add is a boolean, and #use_nonce will always return false. This will cause an "invalid credentials" failure message during the authentication process.

I'm not sure if this should be changed in the source code, but using

return result == true

instead of

return !!(result =~/^STORED/)

in #use_nonce, seems to fix the problem.

phs commented

This also just bit me. Heroku seems to prefer dalli as the memcache client of choice, which may make this a common stumbling block until fixed.

In the meantime intrepid individuals could wrap their dalli client with a small adapter that translated the return values to what OpenID::Store::Memcache expects.

I'm also happy to make a patch.


The adapter I mentioned:


Thank you Phil, I had the same issue deplying with Dalli to Heroku and I think this will help me out.


One year later, still facing the same problem. Thanks this helped.


Closed with ef84bf7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.