The lack of a good browser in a Swing environment is probably the biggest hurtle in this case (IMHO). Can you describe your use case a bit more? Is this a shared terminal or single user? How are you using the credentials once you have them? Are calling a resource server with an access token?
The credentials are being used to do some REST Calls to the Server for updating a local Sqlite Database.
I have been looking into the Okta Docu and maybe the best way to make this happen is to use REST, instead of trying to integrate Web Browser into JSwing