X7ROOT File Manager
Current Path:
/usr/share/doc/neon-0.30.0/html
usr
/
share
/
doc
/
neon-0.30.0
/
html
/
π
..
π
api.html
(2.46 KB)
π
biblio.html
(4.59 KB)
π
compliance.html
(5.09 KB)
π
features.html
(4.59 KB)
π
index.html
(10.81 KB)
π
intro.html
(3.52 KB)
π
ref.html
(7.36 KB)
π
refalloc.html
(4.87 KB)
π
refauth.html
(5.84 KB)
π
refbuf.html
(3.46 KB)
π
refbufapp.html
(4.97 KB)
π
refbufcr.html
(3.24 KB)
π
refbufdest.html
(3.94 KB)
π
refbufutil.html
(3.84 KB)
π
refcert.html
(5.8 KB)
π
refclicert.html
(7.8 KB)
π
refconfig.html
(5.06 KB)
π
referr.html
(4.26 KB)
π
reffeat.html
(4.02 KB)
π
refgetst.html
(3.33 KB)
π
refi18n.html
(3.75 KB)
π
refiaddr.html
(8.93 KB)
π
refneon.html
(12.31 KB)
π
refopts.html
(6.22 KB)
π
refproxy.html
(9.04 KB)
π
refreq.html
(8.51 KB)
π
refreqbody.html
(4.27 KB)
π
refreqflags.html
(4.35 KB)
π
refreqhdr.html
(3.71 KB)
π
refresolve.html
(7.31 KB)
π
refresphdr.html
(5.13 KB)
π
refsess.html
(6.69 KB)
π
refsessflags.html
(5.13 KB)
π
refshave.html
(2.82 KB)
π
refsockinit.html
(6.57 KB)
π
refsslca.html
(3.89 KB)
π
refsslcert2.html
(3.01 KB)
π
refsslcertio.html
(5.48 KB)
π
refssldname.html
(3.78 KB)
π
refsslvfy.html
(7.1 KB)
π
refstatus.html
(4.17 KB)
π
reftok.html
(3.94 KB)
π
refvers.html
(3.3 KB)
π
refxml.html
(2.97 KB)
π
security.html
(6.81 KB)
π
using.html
(4.74 KB)
π
xml.html
(11.03 KB)
Editing: refauth.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_set_server_auth</title><link rel="stylesheet" type="text/css" href="../manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refreqbody.html" title="ne_set_request_body_buffer"><link rel="next" href="refshave.html" title="ne_shave"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_set_server_auth</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refreqbody.html">Prev</a>Β </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right">Β <a accesskey="n" href="refshave.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="refauth"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_set_server_auth, ne_set_proxy_auth, ne_forget_auth β register authentication callbacks</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <ne_auth.h></pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">typedef int (*<b class="fsfunc">ne_auth_creds</b>)(</code></td><td>void *<var class="pdparam">userdata</var>, </td></tr><tr><td>Β </td><td>const char *<var class="pdparam">realm</var>, </td></tr><tr><td>Β </td><td>int <var class="pdparam">attempt</var>, </td></tr><tr><td>Β </td><td>char *<var class="pdparam">username</var>, </td></tr><tr><td>Β </td><td>char *<var class="pdparam">password</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_set_server_auth</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td>Β </td><td>ne_auth_creds <var class="pdparam">callback</var>, </td></tr><tr><td>Β </td><td>void *<var class="pdparam">userdata</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_set_proxy_auth</b>(</code></td><td>ne_session *<var class="pdparam">session</var>, </td></tr><tr><td>Β </td><td>ne_auth_creds <var class="pdparam">callback</var>, </td></tr><tr><td>Β </td><td>void *<var class="pdparam">userdata</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <b class="fsfunc">ne_forget_auth</b>(</code></td><td>ne_session *<var class="pdparam">session</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">Β </div></div></div><div class="refsect1"><a name="idm140368849787040"></a><h2>Description</h2><p>The <em class="type">ne_auth_creds</em> function type defines a callback which is invoked when a server or proxy server requires user authentication for a particular request. The <code class="parameter">realm</code> string is supplied by the server. The <code class="parameter">attempt</code> is a counter giving the number of times the request has been retried with different authentication credentials. The first time the callback is invoked for a particular request, <code class="parameter">attempt</code> will be zero.</p><p>To retry the request using new authentication credentials, the callback should return zero, and the <code class="parameter">username</code> and <code class="parameter">password</code> buffers must contain <code class="literal">NUL</code>-terminated strings. The <code class="literal">NE_ABUFSIZ</code> constant gives the size of these buffers.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>If you only wish to allow the user one attempt to enter credentials, use the value of the <code class="parameter">attempt</code> parameter as the return value of the callback.</p></div><p>To abort the request, the callback should return a non-zero value; in which case the contents of the <code class="parameter">username</code> and <code class="parameter">password</code> buffers are ignored.</p><p>The <code class="function">ne_forget_auth</code> function can be used to discard the cached authentication credentials.</p></div><div class="refsect1"><a name="idm140368849775776"></a><h2>Examples</h2><pre class="programlisting"> /* Function which prompts for a line of user input: */ extern char *prompt_for(const char *prompt); static int my_auth(void *userdata, const char *realm, int attempts, char *username, char *password) { strncpy(username, prompt_for("Username: "), NE_ABUFSIZ); strncpy(password, prompt_for("Password: "), NE_ABUFSIZ); return attempts; } int main(...) { ne_session *sess = ne_session_create(...); ne_set_server_auth(sess, my_auth, NULL); /* ... */ }</pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refreqbody.html">Prev</a>Β </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right">Β <a accesskey="n" href="refshave.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_set_request_body_bufferΒ </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">Β ne_shave</td></tr></table></div></body></html>
Upload File
Create Folder