how .htaccess authentication works with my website via LDAP. How the cookies and sessions are set? -


i using .htaccess authentication website. once authentication happen ad vi ldap, how authenticated user's session , cookies got created in browser , redirection happening website. please in or please share links explains process.

take @ wiki pages basic authentication , digest authentication, both authentication mechanism on protocol (http). basically, browser sees (heavily paraphrasing here):

  1. attempt request uri, webserver replies 401 response , www-authenticate header
  2. this header contains realm, kind of group of pages belong same authentication realm
  3. browser pops modal dialog box asking username , password.
  4. depending on basic or digest, password sent webserver along original request resulted in 401.
  5. if credentials incorrect, 403 returned , browser shows appropriate error message. otherwise, webserver returns requested page.
  6. the browser knows url belongs realm, every time url requested, authorization automatically sent along request.
  7. if browser requests else requires authentication, , belongs same realm, browser automatically send authorization when webserver returns 401 , realm.

how webserver configured realm info , list of credentials varies. hooked ldap database, active directory, flat file hashed passwords, etc.

this different cookies or other webapp-level authentication because doesn't use http protocol authenticate. webapp has page forms username , password, sent via post/get request parameters, , it's webapp determine if credentials valid. if valid, webapp choose store session id cookie browser can continue browse pages served webapp.

one of end-user differences between , http authentication webapp can delete cookie, or invalidate session, logging user out of webapp. isn't possible http authentication because browser blindly submits authorization header when requesting pages under same realm. 1 way around make webserver forcefully return 403 when protected page requested.

another difference http authentication, can include username/password part of url. how http://user:pass@host.com authentication work?

also see: http://blog.distributedmatter.net/post/2008/06/09/http-authentication-mechanisms-and-how-they-could-work-in-restlet more complete description of authentication in general.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -