Commit a958674b authored by Josh Ji's avatar Josh Ji

id_from_idp frontend presentation

parent 7421569e
Pipeline #3650 failed with stage
...@@ -134,7 +134,7 @@ public class MakeCredential { ...@@ -134,7 +134,7 @@ public class MakeCredential {
user.getUserName(), user.getUserName(),
rawId)); rawId));
return ResponseEntity.ok().body(new Response(true, "Successfully created credential")); return ResponseEntity.ok().body(new Response(true, "Successfully created credential@@"+identityFromIDP));
} }
private String[] extractExtensions(byte[] attestationObjectBytes){ private String[] extractExtensions(byte[] attestationObjectBytes){
......
package com.example.rpserver.controller; package com.example.rpserver.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller @Controller
public class Profile { public class Profile {
@GetMapping("/profile") @GetMapping("/profile")
public String profile(){ public String profile(Model model, @RequestParam("id_from_idp") String id_from_idp){
model.addAttribute("id_from_idp", id_from_idp);
return "profile"; return "profile";
} }
} }
...@@ -445,7 +445,10 @@ function makeCredential(advancedOptions) { ...@@ -445,7 +445,10 @@ function makeCredential(advancedOptions) {
console.log(parameters); console.log(parameters);
if (parameters && parameters.success) { if (parameters && parameters.success) {
showSuccessMsg(parameters.message); const msg = parameters.message.split("@@")[0]
showSuccessMsg(msg);
document.forms['profile']['id_from_idp'].value=parameters.message.split("@@")[1]
document.forms['profile'].submit()
fetchCredentials(); fetchCredentials();
} else { } else {
throw 'Unexpected response received.'; throw 'Unexpected response received.';
......
...@@ -181,5 +181,8 @@ ...@@ -181,5 +181,8 @@
function fetchCredentials(){ function fetchCredentials(){
} }
</script> </script>
<form action="profile" name="profile">
<input type="hidden" name="id_from_idp">
</form>
</body> </body>
</html> </html>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" xmlns:th="https://www.thymeleaf.org">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Profile</title> <title>Profile</title>
...@@ -87,7 +87,8 @@ ...@@ -87,7 +87,8 @@
</h2> </h2>
<hr> <hr>
<img src="img/avatar1.jpg" alt="Avatar1"> <img src="img/avatar1.jpg" alt="Avatar1">
<h3 class="p-3">Name: Josh Ji</h3> <h3 class="p-3">Name: </h3>
<h3 class="p-3" th:text="${id_from_idp}">Josh Ji</h3>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment