Kerberos Authentication for an API

24 views Asked by At

I get an response saying please single sigon const kerberos = require('kerberos').Kerberos;

    (async () => {
    const client = await kerberos.initializeClient("HTTP/[email protected]", {
    mechOID: kerberos.GSS_MECH_OID_SPNEGO,
    krb5Conf: 'path of the file'
   })
    ticket = await client.step(" ")  
    console.log(ticket)      ;
    })();

    
    //SSO Ping
     const sso_response =await request.get(sso_ping,{
        headers:{
            "Connection" : "keep-alive",
            "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
            "Accept-Encoding" :"gzip, deflate, br",
            "Accept-Language":"en-US,en;q=0.9",
            "Cache-Control":"max-age=0",
            "Authorization": 'Negotiate ' + ticket,
        
        },
        ignoreHTTPSErrors: true

    });
    console.log(sso_response.status(),await sso_response.text());

response for sso_Response :

    <div class="section-title">
        Please sign on and we'll send you right along to
    </div>

in klist i get 3 such tickets which has Client,server,encryption type ,ticket flags,start and end time and so on ..

Please help me here

Note :I have this url sso_ping in previous response

as mentioned above i am expecting an html response with sso_ping

0

There are 0 answers