The error number is too general and mostly come everywhere when you are trying to do something which you are not authorised to.
It is in the login page so if you are accessing Active directory that could also be one of the reason.
Can you post the code please.
Best Luck..
Nilesh