PureCode Software interview question

How do you handle authentication and authorization in a web application?