Welcome! Log In Create A New Profile

Advanced

How to read http_userid's Base64 encoded userid from Ruby?

Sven C. Koehler
February 09, 2010 07:24AM
Hey,

I am using the http user id module and have not yet figured out how I can
read the base64 encoded cookie from Ruby. It seems like nginx uses a
different form of base64 than Ruby does...

Example:
| uid value = E2F32BD0F154704B0C176D1D02050303

In Ruby I see the cookie encoded like this:

| {"uid"=>"0Cvz4ktwVPEdbRcMAwMFAg=="}
When I try to decode this value with Base64 in Ruby I get:

| require "base64"
| enc="0Cvz4ktwVPEdbRcMAwMFAg=="
| => "0Cvz4ktwVPEdbRcMAwMFAg=="
| Base64.decode64(enc)
| => "\320+\363\342KpT\361\035m\027\f\003\003\005\002"


Has anyone an idea about what I am doing wrong here?

-S.

[nginx.conf entries regarding http userid]
| userid on;
| userid_name uid;
| userid_domain foo.com;
| userid_path /;
| userid_expires 720d;
| userid_p3p 'policyref="/w3c/p3p.xml", CP="ADMa DEVa PSAa PSDa OUR IND DSP NON COR"';


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to read http_userid's Base64 encoded userid from Ruby?

Sven C. Koehler February 09, 2010 07:24AM

Re: How to read http_userid's Base64 encoded userid from Ruby?

Luca De Marinis February 09, 2010 09:54AM

Re: How to read http_userid's Base64 encoded userid from Ruby?

Sven C. Koehler February 09, 2010 10:56AM

Re: How to read http_userid's Base64 encoded userid from Ruby?

dhaval d. September 09, 2011 03:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready