简体   繁体   中英

How do I make a HTTP GET request to a Kerberos protected site using Elixir (or Erlang)?

Essentially I would like to do this ( Python ) but in Elixir:

import requests
from requests_kerberos import HTTPKerberosAuth, OPTIONAL
kerberos_auth = HTTPKerberosAuth(mutual_authentication=OPTIONAL)
r = requests.get("http://example.org", auth=kerberos_auth)

I know I can just do :

HTTPotion.get "http://example.org"

But I cannot find an example (with HTTPotion or any other Elixir library) that supports kerberos negotiation for Elixir (or Erlang)

Is crafting a command line call of curl the only path forward?

This library claims to support SPNEGO, which is what is required for kerberos based http. I have no idea how well it actually works.

https://github.com/mikma/egssapi

It's pretty old, but SPNEGO and kerberos API's haven't changed much in the last 7 years.

As a general rule, unless the underlying library driving the web connection is libcurl, SPNEGO is not well supported in most languages. Java and C are pretty much it when it comes to robust working kerberos implementations; the easier it is for the language to interact with those libraries, the more likely kerberos support will be available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM