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
14752a87
Commit
14752a87
authored
Aug 20, 2022
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入詢問IDP的流程
parent
6801ea37
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
428 additions
and
365 deletions
+428
-365
.idea/misc.xml
.idea/misc.xml
+3
-0
gaedemo.iml
gaedemo.iml
+0
-11
pom.xml
pom.xml
+8
-1
src/main/java/com/google/webauthn/gaedemo/objects/AttestationObject.java
...om/google/webauthn/gaedemo/objects/AttestationObject.java
+0
-1
src/main/java/com/google/webauthn/gaedemo/objects/AuthenticationExtensionsClientInputs.java
...gaedemo/objects/AuthenticationExtensionsClientInputs.java
+7
-0
src/main/java/com/google/webauthn/gaedemo/servlets/BeginMakeCredential.java
...google/webauthn/gaedemo/servlets/BeginMakeCredential.java
+4
-0
src/main/java/com/google/webauthn/gaedemo/servlets/FinishMakeCredential.java
...oogle/webauthn/gaedemo/servlets/FinishMakeCredential.java
+183
-132
src/main/webapp/WEB-INF/web.xml
src/main/webapp/WEB-INF/web.xml
+220
-220
src/main/webapp/js/webauthn.js
src/main/webapp/js/webauthn.js
+3
-0
No files found.
.idea/misc.xml
View file @
14752a87
...
...
@@ -12,4 +12,7 @@
</option>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"1.8.0_221"
project-jdk-type=
"JavaSDK"
/>
<component
name=
"ProjectType"
>
<option
name=
"id"
value=
"jpab"
/>
</component>
</project>
\ No newline at end of file
gaedemo.iml
deleted
100644 → 0
View file @
6801ea37
<?xml version="1.0" encoding="UTF-8"?>
<module
version=
"4"
>
<component
name=
"FacetManager"
>
<facet
type=
"google-app-engine"
name=
"Google App Engine"
>
<configuration
/>
</facet>
<facet
type=
"app-engine-standard"
name=
"Google App Engine Standard"
>
<configuration
/>
</facet>
</component>
</module>
\ No newline at end of file
pom.xml
View file @
14752a87
...
...
@@ -7,7 +7,7 @@
<version>
1.0-SNAPSHOT
</version>
<groupId>
com.google.webauthn
</groupId>
<artifactId>
gaedemo
</artifactId>
<artifactId>
webauthn-demo-josh
</artifactId>
<!-- [START set_versions] -->
<properties>
...
...
@@ -26,6 +26,13 @@
<!-- [END set_versions] -->
<dependencies>
<!--Unirest-->
<dependency>
<groupId>
com.konghq
</groupId>
<artifactId>
unirest-java
</artifactId>
<version>
3.13.6
</version>
<classifier>
standalone
</classifier>
</dependency>
<!-- Compile/runtime dependencies -->
<dependency>
<groupId>
com.google.cloud
</groupId>
...
...
src/main/java/com/google/webauthn/gaedemo/objects/AttestationObject.java
View file @
14752a87
...
...
@@ -74,7 +74,6 @@ public class AttestationObject {
case
"attStmt"
:
attStmt
=
attObjMap
.
get
(
key
);
break
;
}
}
}
...
...
src/main/java/com/google/webauthn/gaedemo/objects/AuthenticationExtensionsClientInputs.java
View file @
14752a87
...
...
@@ -86,6 +86,13 @@ public class AuthenticationExtensionsClientInputs {
return
keyPair
;
}
public
void
addPrlabExtension
(){
if
(
registrationExtensions
==
null
)
{
registrationExtensions
=
new
JsonObject
();
}
registrationExtensions
.
addProperty
(
"PRLab"
,
true
);
}
/**
* @return registration extensions.
*/
...
...
src/main/java/com/google/webauthn/gaedemo/servlets/BeginMakeCredential.java
View file @
14752a87
...
...
@@ -108,6 +108,10 @@ public class BeginMakeCredential extends HttpServlet {
storedKeyPair
.
save
(
session
.
getId
());
}
catch
(
Exception
e
)
{}
/* josh start */
extensions
.
addPrlabExtension
();
/* josh end */
optionsJson
.
add
(
"extensions"
,
extensions
.
getRegistrationExtensions
());
response
.
setContentType
(
"application/json"
);
...
...
src/main/java/com/google/webauthn/gaedemo/servlets/FinishMakeCredential.java
View file @
14752a87
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/web.xml
View file @
14752a87
This diff is collapsed.
Click to expand it.
src/main/webapp/js/webauthn.js
View file @
14752a87
...
...
@@ -96,6 +96,7 @@ function _fetch(url, obj) {
function
fetchCredentials
()
{
_fetch
(
'
/RegisteredKeys
'
).
then
(
response
=>
{
let
credentials
=
''
;
console
.
log
(
response
);
for
(
let
i
in
response
)
{
let
{
handle
,
base64handle
,
publicKey
,
name
,
date
,
id
,
transports
,
userVerificationMethod
}
=
response
[
i
];
const
trimmedHandle
=
base64handle
.
replace
(
/=/g
,
''
);
...
...
@@ -448,6 +449,8 @@ function getAssertion() {
const
requestOptions
=
{};
_parameters
=
parameters
;
console
.
log
(
parameters
)
requestOptions
.
challenge
=
strToBin
(
parameters
.
challenge
);
if
(
$
(
'
#customTimeout
'
).
value
!=
''
)
{
requestOptions
.
timeout
=
$
(
'
#customTimeout
'
).
value
;
...
...
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