Skip to content

linkWithRedirect does not work with auth emulator #4275

Open
@smousa

Description

@smousa

[REQUIRED] Describe your environment

  • Operating System version: Ubuntu 20.10
  • Browser version: Chromium 87.0.4280.88 snap
  • Firebase SDK version: 8.18.0
  • Firebase Product: auth emulator

[REQUIRED] Describe the problem

Steps to reproduce:

  1. Configure application to connect to Firebase Auth emulator

  2. Log into application using "google auth" credentials

  3. Unlink "google auth" credentials from the user by calling

firebase.auth().currentUser.unlink('google.com')
  1. Relink "google auth" credentials to the user by calling
const googleProvider = new firebase.auth.GoogleAuthProvider()
firebase.auth().currentUser.linkWithRedirect(googleProvider)

Relevant Code:

// IMPORTANT: make sure you are connected to the emulator!!!

import firebase from 'firebase/app'

const provider = new firebase.auth.GoogleAuthProvider

// This happens out of band
auth.signInWithRedirect(provider)

// I don't think this is exceptional to me unlinking and
// relinking, but just in case...
async function unlinkAndRelink() {
  await firebase.auth().currentUser.unlink('google.com')
  await firebase.auth().currentUser.linkWithRedirect(provider)
}

Results

{"error":{"code":400,"message":"API key not valid. Please pass a valid API key.","errors":[{"message":"API key not valid. Please pass a valid API key.","domain":"global","reason":"badRequest"}],"status":"INVALID_ARGUMENT"}}"

Console:
auth.esm.js?b7aa:219 GET https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=fake-api-key&cb=1610124371002 400

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions