How to run module code on a specific page/path?
You can use OAuth2 Authentication. Some details about it, from its project page:

... allows users to log into your Drupal site authenticating against a remote identity provider (IDP) via OAuth2.
That is, if a user's credentials can be used to retrieve a valid access token, he/she will be logged into the site with those credentials and the token will be added to his/her session. If the user doesn't exist yet, it will be created.