okta / okta-idx-java

okta-idx-java
https://github.com/okta/okta-idx-java
Other
14 stars 23 forks source link

Establish a Confidential Client #440

Closed scenariotrader closed 1 year ago

scenariotrader commented 1 year ago
    @PostMapping(path = "/verify", produces = {
                    MediaType.APPLICATION_JSON_VALUE })
    public ResponseEntity<Registration> verify(@RequestParam(name = "token") String activationToken,
                    @RequestBody(required = false) Registration registration, final HttpServletRequest request,
                    final HttpSession session) {

            final RequestContext requestContext = OktaUtils.constructRequestContext();
            requestContext.setUserAgent(request.getHeader("USER-AGENT"));
            requestContext.setIpAddress(request.getRemoteAddr());

            AuthenticationResponse beginResponse = idxAuthenticationWrapper.beginUserActivation(activationToken,
                            requestContext);

            log.info("Begin Response Status {}",
                            beginResponse.getAuthenticationStatus());

             return new ResponseEntity<>(HttpStatus.OK);

}

Okta returns error: Error Detail: [invalid_request:Only confidential clients can use the activation token flow]

Question: How do you establish a confidential client

arvindkrishnakumar-okta commented 1 year ago

@scenariotrader I'm guessing you're asking how to create a confidential client in Okta?

You could create a simple app using the developer console UI and use the client-id/client-secret to establish the confidential client:

image

Let me know if that helps!

arvindkrishnakumar-okta commented 1 year ago

Closing this due to inactivity, feel free to reopen with comments if needed.