problem with custom long for long username from facebook

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
dannyrg
Posts: 19
Joined: 19 Oct 2010, 19:08

problem with custom long for long username from facebook

Post by dannyrg »

I'm encountering a weird problem:

implementing a custom login, where I am transferring the new "signed_request" OAuth2.0 info from facebook as the username.

The expectation is to receive it at the "loginRequest" implementation and decode it to get the actual UID.

The problem is, that even though OpenSpace sends the full length of the "signed_request" (which is about 120 chars), properly encoded into the login json string (I can see it in the debug window info), on the server side, when I take the "nick" param from the internalevent, it is always no more than 60 chars.

I tried just sending 120 1's as the string, and again, only 60 arrive.
(tested with string.length() output to extension trace)

So this is weird. why would anyone truncate "nick" to be anything less than length of String type?

Is there a way to overcome this?

Here's some info from Facebook about the "signed_request":

The signed_request parameter is a simple way to make sure that the data you're receiving is the actual data sent by Facebook. It is signed using your application secret which is only known by you and Facebook. Without this secret, third parties cannot modify the signed_request parameter without also invalidating its contents.

The signed_request parameter is the concatenation of a HMAC SHA-256 signature string, a period (.), and a base64url encoded JSON object. It looks something like this (without the newlines):

vlXgu64BQGFSQrY0ZcJBZASMvYvTHu9GQ0YM9rjPSso
.
eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsIjAiOiJwYXlsb2FkIn0
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Use <MaxUserNamesLen> in your zone tags. See http://www.smartfoxserver.com/docs/docP ... s.htm#zone
Smartfox's forum is my daily newspaper.
Post Reply