Or you could make your include a simple localhost web server in your app, let the redirect be to localhost:8080/redirect or just localhost:8080. Then handling the authentication on the users’ computer.
It might not work properly since you would have to store the client id somewhere inside the app, which might be compromised (unless all users register their own app, and use that client id)
A different approach might be if you set up a hosted server that authenticates and then redirects to the localhost server, passing on the api key.