views:

200

answers:

3

Hi folks,

I'm wanting to save some OpenId fields to a database table, such as

  • OpenId identifier
  • Full Name
  • Alias
  • Email
  • etc..

is there a place that summerizes the datatypes and lengths for all the common schema fields? I know there are custom ones (per provider) .. but what about the common ones?

Eg. email -> nvarchar(250) .. or something.

cheers :)

+1  A: 

Use common sense for the email. I've never seen an email address longer than 40-50 chars. Any address that is longer, may be spam or a fake one.

edit: looking at the email RFC, the maximum length of an email address may be 64 (the username) + 1 (the '@' char) + 255 (the domain). Anyway, I would go for a maximum length of 100 or less, still.

friol
@ Friol: where did u get this info from? links? are there any standards documents describing the schema for openid?
Pure.Krome
Wikipedia has some links to the RFC and a brief description: http://en.wikipedia.org/wiki/E-mail_address#RFC_specification
Rob Hruska
What about openID schema's .. not just (generic) email addresses... ??
Pure.Krome
+2  A: 

An OpenID identifier can technically be as long as a legal URL can be (practically around 2K), but I'd say 150 characters is a good maximum.

Incidentally be sure to store the Claimed Identifier as the primary key (or equivalent lookup column) rather than the user-supplied identifier or any other variation that you might see in the authentication process. Also, to really be secure, you need to do a case sensitive comparison on the path of the URL (you can be case insensitive in the host area). Since the case sensitivity issue is complicated, I just always normalize the host to lowercase, and then do a case sensitive compare on the whole string.

Andrew Arnott
A: 

See OpenID Simple Registration Extension 1.0:

openid.sreg.email: The email address of the End User as specified in section 3.4.1 of [RFC2822].

any chance you could tell me what the max email length is for RFC2822? There's too much text to read :(
Pure.Krome