Make OAuth2 handshake test more versatile

Description:
Previously, if you changed the port or the domain in local.json this
test would fail.