It uses the full flow OAuth2. You will need to register your app on the server and then configure the app before you can login.
GitHub - go to new OAuth app, name the app, point the callback to http://yourhost:port/gh/callback. No need to specify permissions scopes as they are handled at the access time. Copy key and secret and then set GH_OAUTH2_ID and GH_OAUTH2_SECRET environment variables and run the app so it can store them. With docker you can do it using the docker -e option.
Bitbucket - go to new OAuth consumer. Give read permissions to the account and the repositories. Point the callback to http://yourhost:port/bb/callback. Copy key and secret and then set BB_OAUTH2_ID and BB_OAUTH2_SECRET environment variables and run the app so it can store them
Authentication details are saved in the configstore, so you only need to do it once. To reset authentication simply remove .config/configstore.
This is a full stack app (server and client js). It could be done as a client-only single page app, but handling the GitHub OAuth SPA flow and API pagination would be tricky.