Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webauthn-demo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josh Ji
webauthn-demo
Commits
30f1a61f
Commit
30f1a61f
authored
Nov 22, 2021
by
0Tyler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add UserProxyService to get username
parent
8ac11886
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
src/main/java/com/google/webauthn/gaedemo/servlets/BeginGetAssertion.java
...m/google/webauthn/gaedemo/servlets/BeginGetAssertion.java
+9
-0
src/main/java/com/google/webauthn/gaedemo/servlets/FinishGetAssertion.java
.../google/webauthn/gaedemo/servlets/FinishGetAssertion.java
+9
-0
No files found.
src/main/java/com/google/webauthn/gaedemo/servlets/BeginGetAssertion.java
View file @
30f1a61f
...
...
@@ -14,6 +14,7 @@
package
com.google.webauthn.gaedemo.servlets
;
import
com.google.appengine.api.users.User
;
import
com.google.appengine.api.users.UserService
;
import
com.google.appengine.api.users.UserServiceFactory
;
import
com.google.common.base.Splitter
;
...
...
@@ -21,6 +22,7 @@ import com.google.common.collect.Iterables;
import
com.google.gson.JsonObject
;
import
com.google.webauthn.gaedemo.objects.AuthenticationExtensionsClientInputs
;
import
com.google.webauthn.gaedemo.objects.PublicKeyCredentialRequestOptions
;
import
com.google.webauthn.gaedemo.service.UserProxyService
;
import
com.google.webauthn.gaedemo.storage.SessionData
;
import
java.io.IOException
;
import
javax.servlet.ServletException
;
...
...
@@ -47,7 +49,14 @@ public class BeginGetAssertion extends HttpServlet {
@Override
protected
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
/* Tyler start -----------------*/
UserProxyService
userProxyService
=
UserProxyService
.
getInstance
();
User
user
=
userProxyService
.
getCurrentUser
();
String
currentUser
=
(
user
!=
null
)
?
user
.
getEmail
()
:
userService
.
getCurrentUser
().
getEmail
();
/* Tyler end -----------------*/
/* Original code
String currentUser = userService.getCurrentUser().getEmail();
*/
String
rpId
=
Iterables
.
get
(
Splitter
.
on
(
':'
).
split
(
request
.
getHeader
(
"Host"
)),
0
);
// String rpId = (request.isSecure() ? "https://" : "http://") + request.getHeader("Host");
PublicKeyCredentialRequestOptions
assertion
=
new
PublicKeyCredentialRequestOptions
(
rpId
);
...
...
src/main/java/com/google/webauthn/gaedemo/servlets/FinishGetAssertion.java
View file @
30f1a61f
...
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
javax.xml.bind.DatatypeConverter
;
import
com.google.appengine.api.users.User
;
import
com.google.appengine.api.users.UserService
;
import
com.google.appengine.api.users.UserServiceFactory
;
import
com.google.common.io.BaseEncoding
;
...
...
@@ -35,6 +36,7 @@ import com.google.webauthn.gaedemo.objects.AuthenticatorAssertionResponse;
import
com.google.webauthn.gaedemo.objects.PublicKeyCredential
;
import
com.google.webauthn.gaedemo.server.PublicKeyCredentialResponse
;
import
com.google.webauthn.gaedemo.server.Server
;
import
com.google.webauthn.gaedemo.service.UserProxyService
;
import
com.google.webauthn.gaedemo.storage.Credential
;
...
...
@@ -58,7 +60,14 @@ public class FinishGetAssertion extends HttpServlet {
@Override
protected
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
/* Tyler start -----------------*/
UserProxyService
userProxyService
=
UserProxyService
.
getInstance
();
User
user
=
userProxyService
.
getCurrentUser
();
String
currentUser
=
(
user
!=
null
)
?
user
.
getEmail
()
:
userService
.
getCurrentUser
().
getEmail
();
/* Tyler end -----------------*/
/* Original code
String currentUser = userService.getCurrentUser().getEmail();
*/
String
data
=
request
.
getParameter
(
"data"
);
if
(
data
==
null
)
{
data
=
""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment