I'm wanting to save some OpenId fields to a database table, such as
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 :)
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With