This is not possible. According to https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow#origin-validation for js origin validation rules, "Hosts cannot be raw IP addresses. Localhost IP addresses are exempted from this rule."