simple question. With ktor-oauth, does HttpClient ...
# ktor
s
simple question. With ktor-oauth, does HttpClient need to be
Apache
? It doesn't seem to want to accept
Tomcat
, but I don't want to run two applications servers just to use oauth.
t
It doesn’t seem to want to accept
Tomcat
What do you mean by this?
s
idea64_2020-01-24_20-54-56.png
I'm assuming that Apache is the HTTP server, and not the web container. I only have the
ktor-server-tomcat
dependency in my project, that's why I make that assumption
I'm guessing that Tomcat won't be able to double as the HTTP client here for some reason.
t
It looks like your
HttpClient
isn’t an instance of
HttpClientEngine
. Do you need to create a wrapper class or something?
s
Tomcat is a built in ktor servlet, in
ktor-server-tomcat
. I didn't create it. I just wanted to confirm that I'd need to add apache as a dependency, even though I already have tomcat.
t
Yeah, I’m not sure - someone else might be able to answer. But to me, this doesn’t necessarily look like the problem is you haven’t added Apache. The problem is your HttpClient doesn’t extend HttpClientEngine, which is what the OAuth configuration is expecting.
You may be able to resolve this without adding a dependency on Apache
s
yeah I understand that.
t
What is
Tomcat
in
HttpClient(Tomcat)
?
m
Tomcat is a server engine. You'd want to use one of the client engines: https://ktor.io/clients/http-client/engines.html