Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linkWithRedirect does not work with auth emulator #4275

Open
smousa opened this issue Jan 8, 2021 · 1 comment
Open

linkWithRedirect does not work with auth emulator #4275

smousa opened this issue Jan 8, 2021 · 1 comment

Comments

@smousa
Copy link

smousa commented Jan 8, 2021

[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

@rosalyntan
Copy link
Member

Thanks for filing this issue! I've filed b/177944015 for internal tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants