-
Notifications
You must be signed in to change notification settings - Fork 455
get sub on signup #335
Comments
Wondering how to do the same. seems like it could be put on the response from |
@sehmaschine can you describe your use case in more detail? |
@aaronelasticmedia I'm having a database with a user table (and lots of relations to the user). This table has a primary key (ID) and a field sub. I'm mainly using the internal ID in order to reference the user (makes testing and writing fixtures much easier). Therefore, I need to create an entry within that table once a new user registered. @collinforrester The current workaround is this: Instead of creating the user entry on signup I add the user with the first login. I check if an entry with sub already exists with the internal user table and I create a new entry if it doesn't. With my API, I'm using the token to get sub and then I query the internal user table to get the user ID. I hope my use case is understandable. I'm just surprised that signup does return username instead of sub – although sub is the unique value which actually identifies the user. |
We are working on a feature to return the sub on the sign up call. This will be available in the near future. |
@itrestian That's great news. IMO, the unique identifier ( |
@sehmaschine why don't you save your internal ID as a custom attribute in Cognito ? |
@jogold Mainly because the registration could fail and then I end up with a user in my database which needs to be deleted (when I create that user beforehand). Doesn't seem like a clean solution IMHO. |
Are you using javascript? Or what is the SDK/language that you are using? |
Yes, javascript. |
@itrestian Is there any news of this feature? |
Stumbled upon this little bug today. Any updates? |
+1 to include the sub in the signup response |
SignUp API now returns sub in response. |
The response from Use Case 1 (in README) still does not return It seems like
As a reminder, User Case 1 is as follows:
Thanks! |
The sub should be available in the newest version. |
How can I get this update? I am using aws@1.6.0 |
I'm still not able to get the sub after a signup.
Thanks before hand |
@sehmaschine - once you have 'sub' of the new user how do you pass it to the backend in a reliable way, avoiding fake submissions? |
@scheler We decided to dump cognito in favor of a custom solution (for a variety of reasons). Therefore, I'm not able to answer your question. But if I remember it correctly, we did not pass |
First off, thanks for this library – it's been working great so far.
I have one last issue though: When a user registered, I need to add an entry to my user table with a reference to
sub
(in order to later get the logged-in user).If I'm not mistaken, I can only get
sub
withgetUserAttributes
which is only possible with an authenticated user. Is there a way to getsub
when the user has registered (or confirmed the registration)?The text was updated successfully, but these errors were encountered: