[keycloak-user] Library for external HTTP calls.

Dmitry Telegin dt at acutus.pro
Thu Nov 22 04:17:29 EST 2018


Hello Marco,

Keycloak ships Apache HttpClient, and offers HttpClientSpi for obtaining a preconfigured HttpClient instance:

HttpClientProvider provider = session.getProvider(HttpClientProvider.class);

InputStream is = provider.get("http://...");
// or
in rc = provider.postText("http://...", "foo=bar");
// or
HttpClient httpClient = provider.getHttpClient();

See org.keycloak.connections.httpclient.DefaultHttpClientFactory::lazyInit() for the list of configurable options.

Cheers,
Dmitry Telegin
CTO, Acutus s.r.o.
Keycloak Consulting and Training

Pod lipami street 339/52, 130 00 Prague 3, Czech Republic
+42 (022) 888-30-71
E-mail: info at acutus.pro

On Thu, 2018-11-22 at 08:11 +0000, marco.scheuermann at daimler.com wrote:
> Hi community,
> 
> I wrote a keycloak extension based on Authenticator SPI.
> What is currently the preferred way to do HTTP calls to an external system within a provider module?
> Which library should I use for that purpose?
> Should I use an external one, like e.g. Apache HTTP Client or a lib already packaged with keycloak.
> 
> Thank you,
> Marco
> 
> 
> Marco Scheuermann
> 
> Dipl.-Informatiker
> 
> >  [id:image001.png at 01D3CB2E.313F1BF0]
> 
> Software Engineer
> RD/UIA – Team Rising Stars
> Tel.:       +49 151 5860 5255
> E-Mail:  marco.scheuermann at daimler.com
> 
> Daimler AG
> Sitz und Registergericht/Domicile and Court of Registry: Stuttgart
> HRB-Nr./Commercial Register No. 19360
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Manfred Bischoff
> Vorstand/Board of Management: Dieter Zetsche (Vorsitzender/Chairman), Wolfgang Bernhard, Renata Jungo Brüngger, Ola Källenius, Wilfried Porth, Hubertus Troska, Bodo Uebber, Thomas Weber
> 
> 
> If you are not the addressee, please inform us immediately that you have received this e-mail by mistake, and delete it. We thank you for your support.
> 
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user


More information about the keycloak-user mailing list