Added authentification check.

http://doc.owncloud.com/server/4.5/developer_manual/security.html