login(+Request, +ServerID, +TokenInfo) is semidet[multifile, swish(lib/oauth2)]
Multifile hook to realise the actual login. Normally this hook shall create a session and associate the session with the identity of the user. This hook may keep track of a user profile.

If this hook fails, oauth2_reply/2 returns a text/plain document with the obtained information. This can be used for debugging and development purposes.

Arguments:
Request- is the HTTP request dealing with the redirect back from the identity provider.
ServerID- identifies the identity provider.
TokenInfo- is a dict containing information about the access token.
UserInfo- is a dict containing information about the user.
 oauth2:login(+Request, +ServerID, +TokenInfo)[multifile, 'config-enabled/auth_google.pl']
Called after the identity provider behind ServerID verified the user's identity. Now we have several options. If we do not have our own user admin, we associate the session with the user and we are done. If we have our own admin we have to check with our profile database. For new users we may wish to complete the profile. We may want to reject banned users or users that do not wish to complete their profile.