apache - HTTP authentication versus cookies -


it seems cookie based authentication clear choice today web services require login credentials.

but if you're developing web service clients not browsers, client software (such mobile app) accesses resources via http, use http authentication or cookie authentication?

http auth:

  • web server handles authentication, easier change web app platform if needed
  • automatically applied non-code resources (e.g. jpg, xml, etc) (side q: there way cookie-based auth?)
  • harder integrate database-stored credentials server auth (.htaccess/.htpasswd)

cookie auth:

  • fine grained access controls (a code resource can respond differently based on credentials)
  • control on expiration of session (via cookie expirations)
  • full control on user login experience

what other considerations leaving out? other pros/cons?

some helpful discussion here

with http authentication, code resource can respond differently based on user made request. name of user passed code via http header.

with http authentication, can still use sessions , have same benefits bring. in fact, session stealing not of problem anymore, because can test whether user stored in session same authenticated via http authentication. same reason, session identifiers need not unguessable need cookie based authentication.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -