Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify rpserver's application.yml - endpoint get-delete-credentials #55

Open
nets-co-kr opened this issue Sep 10, 2024 · 0 comments
Open

Comments

@nets-co-kr
Copy link

hi

Error “404 NOT_FOUND” while running CredentialController.getCredentialWithCredentialId() method in rpserver.

HTTP GET http://localhost:8081/fido2/credentialsoGLOKkzWdCoIOLa?rpId=localhost
Response 404 NOT_FOUND

I think add a new uri path

 getDeleteCredentialsUri: "/fido2/credentials"
 getDeleteCredentialsIdUri: "/fido2/credentials/"

or add path "/" inside the getCredentialWithCredentialId() and deleteCredentialWithCredentialId()

  UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(getDeleteCredentialsUri + "/");

please check this issue.


application.yml

fido2-server:
  endpoint:
    get-delete-credentials: /fido2/credentials

CredentialController

 getDeleteCredentialsUri = uriComponentsBuilder
                .scheme(scheme)
                .host(fidoServerHost)
                .port(fidoServerConfig.getPort())
                .path(fidoServerConfig.getEndpoint().getGetDeleteCredentials())  // "/fido2/credentials"
                .build().toUriString();

#OK (Matched Path "/fido2/credentials")

path(="/credentials")
getCredentialsWithUsername()
deleteCredentialWithUserName()

#Error (Matched Path = "/fido2/credentials/{id}")

path(="/credentials/{id}")
getCredentialWithCredentialId()
deleteCredentialWithCredentialId()

---

@GetMapping(path = "/credentials/{id}")
    public GetCredentialResult getCredentialWithCredentialId(
            @PathVariable("id") String credentialId) {

        // Error 
        UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(getDeleteCredentialsUri);
        // OK
        UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(getDeleteCredentialsUri + "/");
        URI uri = uriComponentsBuilder.path(credentialId)
                                      .queryParam("rpId", rpId)
                                      .build().toUri();

        ResponseEntity<GetCredentialResult> response = restTemplate
                .exchange(uri, HttpMethod.GET, null, GetCredentialResult.class);

        return response.getBody();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant