<div dir="ltr">Hi all,<div><br></div><div>I am implementing a web application for cloud services called the Mozilla Geolocation Service Leaderboard, which will utilize FXA for user accounts.</div><div><br></div><div><a href="https://github.com/mozilla-services/location-leaderboard">https://github.com/mozilla-services/location-leaderboard</a><br></div><div><br></div><div>My original plan was to store the FXA access token and the FXA UID in the database, as well as pass both of those to the client.  When the client wants to make an API call, it will provide the UID as a way to identify itself and the access token to authorize the call.  </div><div><br></div><div>I was going to store both in the database, but I think that I don't need to store the access token at all, it can be stored only in the client, passed to the server through an Authorization header during a request, relayed to FXA for validation, and the call is considered authorized.  In this case I only need to store the FXA UID.  </div><div><br></div><div>However, if I only use the FXA UID as a way to identify a user, then that is the parameter that will appear in all API calls to identify users, which means this FXA UID will be publicly available.  </div><div><br></div><div>In his security review, Julien had suggested that the FXA UID should remain 'restricted' to within the server database and not exposed through the API.  </div><div><br></div><div>If this is the case, then I will need to create a UID which is local to just the leaderboard, and store both the leaderboard UID and the FXA UID on my user table to correlate the two.  This is possible but perhaps more work than is necessary, particularly because I will need to 1) receive the access token from the client 2) validate it with FXA and 3) receive a payload from FXA which includes the FXA UID and then use that to identify the user in my local database table.</div><div><br></div><div>Is it necessary to store both a local UID and an FXA UID in my database, or is it reasonable to use only the FXA UID to identify a user?</div><div><br></div><div>Thanks!</div><div><br></div><div>Jared Kerim</div><div>Geolocation</div><div>Cloud Services</div></div>