lib/openid/store/redis.rb
# Use nonce and store that it has been used in Redis temporarily
#
# Returns true if nonce has not been used before and is still usable,
Use nonce and store that it has been used in Redis temporarily
Returns true if nonce has not been used before and is still usable.
Use nonce and store that it has been used in Redis temporarily Returns true if nonce has not been used before and is still usable .
def use_nonce(server_url, timestamp, salt)
        return false if (timestamp - Time.now.to_i).abs > Nonce.skew
        ts = timestamp.to_s 
        nonce_key = prefix + ':n:' + server_url + ':' + ts + ':' + salt
        if @redis.setnx(nonce_key, '')
          @redis.expire(nonce_key, Nonce.skew + 5)
          true
        else
          false
        end
      end
def use_nonce ( server_url , timestamp , salt ) return false if ( timestamp - Time . now . to_i ) . abs > Nonce . skew ts = timestamp . to_s nonce_key = prefix + ':n:' + server_url + ':' + ts + ':' + salt if @redis . setnx ( nonce_key , '' ) @redis . expire ( nonce_key , Nonce . skew + 5 ) true else false end end
Use nonce and store that it has been used in Redis temporarily
Returns true if nonce has not been used before and is still usable,
Use nonce and store that it has been used in Redis temporarily Returns true if nonce has not been used before and is still usable
# base 10 seconds since epoch
server_url
<not_specific>
timestamp
<not_specific>
salt
<not_specific>