Overview
Features
Download
Documentation
Community
Add-Ons & Services

Using HTTPDigestCredentials in HttpServer (RequestHandler)

Please post support and help requests here.

Using HTTPDigestCredentials in HttpServer (RequestHandler)

Postby fabian » 14 Nov 2013, 10:25

Hello!

I'm looking for an example how to use Poco::Net::HTTPDigestCredentials in a RequestHandler of a HttpServer.
The Poco documentation only contains an explame for Poco::Net::HTTPBasicCredentials by calling:
Code: Select all
    if(!request.hasCredentials())
    {
        response.requireAuthentication("My Realm");
        response.setContentLength(0);
        response.send();
        [....]
    }
    else
    {
        Poco::Net::HTTPBasicCredentials cred(request);
        const std::string& user = cred.getUsername();
        const std::string& pwd = cred.getPassword();
        [....]
    }

...but I want a HttpDigestAuthentification. Maybe something like:
Code: Select all
    Poco::Net::HTTPDigestCredentials cred("user", "password");

    if(!request.hasCredentials())
    {
        response.requireAuthentication("nonce");
        response.setContentLength(0);
        response.send();
        [....]
    }
    else
    {
        if(cred.verifyAuthInfo(request))
        { [....] }
    }

Thank you very much for your help.
fabian
 
Posts: 1
Joined: 13 Nov 2013, 16:24

Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests