Copied code from the ruby-openid gem AR store example