Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RPServer
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
RPServer
Commits
7421569e
Commit
7421569e
authored
Mar 15, 2023
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get Assertion rp hostname
parent
879545bf
Pipeline
#3639
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
src/main/java/com/example/rpserver/controller/GetAssertion.java
...in/java/com/example/rpserver/controller/GetAssertion.java
+3
-6
No files found.
src/main/java/com/example/rpserver/controller/GetAssertion.java
View file @
7421569e
...
...
@@ -12,10 +12,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.LinkedList
;
import
java.util.List
;
...
...
@@ -27,7 +24,7 @@ public class GetAssertion {
private
CredentialRepository
credentialRepository
;
@ResponseBody
@PostMapping
(
"/BeginGetAssertion"
)
public
ResponseEntity
<
PublicKeyCredentialRequestOptions
>
beginGetAssertion
(
@RequestParam
(
"username"
)
String
username
){
public
ResponseEntity
<
PublicKeyCredentialRequestOptions
>
beginGetAssertion
(
@Request
Header
(
"host"
)
String
hostname
,
@Request
Param
(
"username"
)
String
username
){
Challenge
challenge
=
new
DefaultChallenge
();
List
<
Credential
>
credentials
=
credentialRepository
.
getCredentialsByUserName
(
username
);
LinkedList
<
PublicKeyCredentialDescriptor
>
publicKeyCredentialDescriptors
=
new
LinkedList
<>();
...
...
@@ -35,7 +32,7 @@ public class GetAssertion {
PublicKeyCredentialDescriptor
publicKeyCredentialDescriptor
=
new
PublicKeyCredentialDescriptor
(
PublicKeyCredentialType
.
PUBLIC_KEY
,
credential
.
getRawId
(),
null
);
publicKeyCredentialDescriptors
.
add
(
publicKeyCredentialDescriptor
);
}
PublicKeyCredentialRequestOptions
options
=
new
PublicKeyCredentialRequestOptions
(
challenge
,
null
,
"localhost"
,
publicKeyCredentialDescriptors
,
null
,
null
);
PublicKeyCredentialRequestOptions
options
=
new
PublicKeyCredentialRequestOptions
(
challenge
,
null
,
hostname
.
split
(
":"
)[
0
]
,
publicKeyCredentialDescriptors
,
null
,
null
);
return
ResponseEntity
.
ok
(
options
);
}
@ResponseBody
...
...
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