firebase / firebase/firebase-js-sdk

Firebase auth and Apple Sign-in with multi-tenancy

Open
#3,611 3 comments 0 reactions 0 assignees View on GitHub
api: auth bug internal-bug-filed
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [REQUIRED] Describe your environment

* Operating System version: macOS Mojave 10.14.6
* Browser version: Google Chrome 84.0.4147.105
* Firebase SDK version: 7.17.2
* Firebase Product: auth

### [REQUIRED] Describe the problem

I'm using multi-tenancy in my auth and everything is OK with Facebook and Google. But with Apple Sign-in this don't work.

In firebase console I can to configure Apple witch Sign-in method like the screenshot.
![Screen Shot 2020-08-10 at 15 14 58](https://user-images.githubusercontent.com/5611322/89946503-6bca9680-dbf9-11ea-837a-659020429c6a.png)

But my request return `"The identity provider configuration is not found"` when I add tenancy configuration in auth.

`firebase.auth().tenantId = `

I noticed that Identity Provider cofiguration in Google Cloud Console dont have an Apple provider:
![Screen Shot 2020-08-10 at 15 11 01](https://user-images.githubusercontent.com/5611322/89946532-7553fe80-dbf9-11ea-83ca-dfc5c79727bc.png)

#### Relevant Code:

```javascript

// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "apiKey",
authDomain: "authDomain",
databaseURL: "databaseURL",
projectId: "projectId",
storageBucket: "storageBucket",
messagingSenderId: "messagingSenderId",
appId: "appId",
measurementId: "measurementId"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

firebase.auth().tenantId = '';

const token = '';

const provider = new firebase.auth.OAuthProvider('apple.com');
const fCredential = provider.credential(token);

firebase.auth().signInWithCredential(fCredential)
.then(function (r) {
console.log('Response ', JSON.stringify(r));
}, function (e) {
console.log('Error ', JSON.stringify(e));
});

```

NOTE: if remove tenantId will work, user will be authenticate in root

Contributor guide

Open the contributing guide

Research direction

Start with the shown Firebase Auth flow: tenantId, OAuthProvider('apple.com'), provider.credential, and signInWithCredential using SDK 7.17.2. Reproduce the Apple sign-in request with and without tenantId, then trace the authentication path to determine whether tenant-scoped Apple sign-in completes without the identity-provider configuration error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.