google / u2f-ref-code

U2F reference implementations
BSD 3-Clause "New" or "Revised" License
588 stars 182 forks source link

Add backend APIs for issuing U2F requests and processing U2F responses. #152

Closed xiaoliu1988 closed 7 years ago

xiaoliu1988 commented 7 years ago

Hi @leshi, please review this change!

151

Endpoints APIs include:

  1. return all registered security keys;
  2. issue a registration request;
  3. process a registration response;
  4. issue a signature request;
  5. process a signature response.

Besides adding new APIs, user index in Servlets has been changed from userId to email. The reason is Google Cloud Endpoints is using ID tokens for Android, while ID tokens don't include user ID, so getUserId() always returns null from the authenticated User objects. See Function User.getUserId() in Cloud endpoint api returns null.

In order to consistently track registered through Android apps (using Endpoints APIs) and web based requests, we change all user index from original userId to email.