Execute login plugin only on login page

Hi all!

I have written plugin that checks for certificate and then logs in user. Now i want only users to be logged in when they go to Log In option. If they are not logged in they can see only pages that are available for anonymous users.

How to check url, and login if it correct?