Allow to set hostname

This change allow to specify a custom hostname when asking the token.