supertokens-core icon indicating copy to clipboard operation
supertokens-core copied to clipboard

Change thirdparty userId to be varcahr(255)

Open rishabhpoddar opened this issue 3 years ago • 8 comments

There was an error where someone was trying to sign up using the thirdparty recipe and postgres rejected the query cause of value too long for type character varying(128) - and in the thidparty table, only the third_party_user_id column has 128 chars limit.

Error log reference:

https://app.zenhub.com/files/231921809/8968d6d6-bcdd-48d8-aa60-fd556e934acd/download

rishabhpoddar avatar Sep 03 '21 13:09 rishabhpoddar

@jscyo progress on this?

rishabhpoddar avatar Sep 07 '21 16:09 rishabhpoddar

Information around user-id size from Oauth providers is not explicitly mentioned in their docs.

I've found these two answers which say that varchar(128) should be fine for Google and Facebook

Ive contacted Github and Facebook support for more information about this

jscyo avatar Sep 13 '21 04:09 jscyo

The OIDC defines that the sub claim (the user id) cannot exceed 255 ascii character length, so there is a possibility that some providers are issuing user id's which are more than 128 characters. source

jscyo avatar Sep 14 '21 05:09 jscyo

@jscyo any updates on this?

rishabhpoddar avatar Sep 25 '21 18:09 rishabhpoddar

See what schema keycloack uses for this

rishabhpoddar avatar Sep 28 '21 14:09 rishabhpoddar

The schema for storing social providers for keycloak is as follows:

       Column       |          Type          | Collation | Nullable | Default 
--------------------+------------------------+-----------+----------+---------
 identity_provider  | character varying(255) |           | not null | 
 realm_id           | character varying(36)  |           |          | 
 federated_user_id  | character varying(255) |           |          | 
 federated_username | character varying(255) |           |          | 
 token              | text                   |           |          | 
 user_id            | character varying(36)  |           | not null | 
Indexes:

They use varachar(255) to store their third party user ids.

jscyo avatar Sep 29 '21 11:09 jscyo

Hi @rishabhpoddar ! Is the bug still open to work? I wish to contribute to this as my first ever contribution to OSS. !

Shashwat121 avatar Jan 23 '22 11:01 Shashwat121

hey @Shashwat121! Thanks for showing interest. This issue is being worked on in another PR. Please find another issue that you like. We also have issues in our backend and frontend SDKs :)

rishabhpoddar avatar Jan 23 '22 11:01 rishabhpoddar