I have a web app created in Okta dev. When I’m trying to access the endpoint, it took me to OKTA sign in page and after providing the credentials it re-directed to: https://dns/oauth2/idpresponse?code=XXXX with 500 Internal Server error response.
It sounds like Okta is behaving correctly and redirecting the user back to the provided redirect_uri (from the /authorize call). Are you currently hosting something on that redirect route? Does this at all work when you test your application locally?