firebase / firebase/firebase-js-sdk
FR: Include provider response (token) when throwing admin_only_operation in auth().getRedirectResult
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
* Operating System version: ubuntu 18.04
* Browser version: Chrome 81
* Firebase SDK version: 7.14.2
* Firebase Product: auth
#### Steps to reproduce:
- disable "Enable create (sign-up)" in GCP Identity Platform settings
- add OIDC provider
- use signInWithRedirect and getRedirectResult
- sign in with user from OIDC that isn't in Identity Platform
- the error thrown does not contain the response from the IdP, but **it would be useful to have it** to send to our backend to conditionnaly create the user using the admin sdk (we don't want all users/providers to be allowed to create accounts).
#### Relevant Code:
```javascript
firebase.auth().signInWithRedirect(provider);
/// ...
firebase.auth().getRedirectResult()
.catch(function (error) {
// error is admin_only_operation
// error doesn't contain the IdP result, even though I clearly see in the network tab that it was returned.
})
.then(cred => { /**/ );
```
Contributor guide
Assessment
This issue has not been assessed yet.