Note that there are some explanatory texts on larger screens.

plurals
  1. POGSSAPI get username password and build credential not working for non logged in user
    primarykey
    data
    text
    <p>I am developing a C++ client that uses GSSAPI to login to a server. For the credentials I am using gss methods to build a credential object(explained in code below). My code for this part is</p> <pre><code>#include &lt;gssapi.h&gt; #include &lt;gssapi_krb5.h&gt; #include &lt;gssapi/gssapi_generic.h&gt; #include &lt;gssapi/gssapi_ext.h&gt; gss_cred_id_t method_to_get_cred(){ char *username = "asanyal@DOMAIN.COM"; char *password = "correctpassword"; gss_buffer_desc send_tok; OM_uint32 maj_stat, min_stat; gss_cred_id_t cred; gss_name_t gss_username; gss_OID_set_desc mechs, *mechsp = GSS_C_NO_OID_SET; gss_buffer_desc pwbuf; send_tok.value = username; send_tok.length = strlen(username); maj_stat = gss_import_name(&amp;min_stat, &amp;send_tok,( gss_OID) gss_nt_user_name,&amp;gss_username); if (maj_stat != GSS_S_COMPLETE) { printf("parsing client name %d %d \n ", maj_stat, min_stat); return -1; } printf("Maj stat after gss_import_name: %d \n", maj_stat); printf("Acquired username \n"); //getting username complete //getting password pwbuf.value = password; pwbuf.length = strlen(password); maj_stat = gss_acquire_cred_with_password(&amp;min_stat, gss_username, &amp;pwbuf, 0, mechsp, GSS_C_INITIATE, &amp;cred, NULL, NULL); printf("Acquired password \n"); //getting password complete printf("Maj stat and min stat after gss_acquire_cred_with_password: %d %d\n", maj_stat, min_stat); return(cred); } </code></pre> <p>Now i am printing the major status(gssapi level status) and minor status(mechanism level status)- which is Kerberos in this case. When i am giving the logged in user(i.e. asanyal) the status printf message gives 0 for both values(all goes well)</p> <p>However when I use a different username(this one is registered in the Active Directory but I am not logged in as him) I am getting</p> <pre><code>majstat = 851968 and minstat = -1765328243 </code></pre> <p>Further investigation revealed that this minor status message corresponds to the error </p> <pre><code>KRB5_CC_NOTFOUND Matching credential not found </code></pre> <p>I am certain I am passing correct credentials(username password) for the non logged in users)</p> <p>Is this something wrong with GSSAPI internally(maybe its unable to get a ticket or something) or am I making some mistake?</p> <p>Configuration used : Windows Active Directory (Windows Server 2008) and MIT kerberos libraries - version 4.0.1</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload