firebase / firebase/firebase-js-sdk

FR: Firebase Auth provider-level OIDC claims request support

Open
#10,131 1 comment 1 reaction 0 assignees View on GitHub
api: auth type: feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

Windows 10

### Environment (if applicable)

Chrome 149, Node v24.18.0

### Firebase SDK Version

12.15.0

### Firebase SDK Product(s)

Auth

### Project Tooling

N/A

### Detailed Problem Description

Firebase Auth Web currently exposes `GoogleAuthProvider.addScope()` and `GoogleAuthProvider.setCustomParameters()`, but there does not appear to be a supported way to configure an OpenID Connect `claims` request on `GoogleAuthProvider`.

That makes it difficult to use Google Sign-In security signals that require explicit claims requests while still staying within Firebase Auth’s `signInWithPopup` / `signInWithRedirect` / link / reauthenticate abstractions.

Google documents additional security signals for Sign in with Google, including OIDC claims such as `auth_time` and `amr`.
These are relevant for risk-based account decisions and step-up / recent-auth / authentication-strength checks.

Examples from Google docs:
- `auth_time`
- `amr`

In Google Cloud / Google Identity surfaces, this is related to options such as:
- Session duration claim
- Authentication strength claim

### Current limitation

With the current Firebase Web Auth API, I can do this:

```ts
const provider = new GoogleAuthProvider();
provider.addScope('profile');
provider.addScope('email');
await signInWithPopup(auth, provider);
```

But there is no supported API to express an OIDC claims request like:
```
{
"id_token": {
"auth_time": { "essential": true },
"amr": { "essential": true }
}
}
```

setCustomParameters() also does not seem like the right fit here, since this is not just a simple login hint / prompt parameter. It is a structured OIDC claims request.

**Request**
Please consider adding provider-level support for OIDC claims requests on GoogleAuthProvider (or a suitable shared OAuth/OIDC provider base class).

Not prescribing the exact API, but something conceptually like:
```ts
const provider = new GoogleAuthProvider();
provider.setRequestedIdTokenClaims({
auth_time: { essential: true },
amr: { essential: true },
});
```

**Why this would help**
Right now the workaround is to leave Firebase’s built-in Google popup/redirectflow, perform the Google OIDC/GIS flow manually, and then bridge back intoFirebase with signInWithCredential().
That works, but it adds avoidable complexity for apps that otherwise want tostay inside Firebase Auth’s built-in provider flows.

**Additional context/notes**
I can take an incremental approach to ensure stability.
Is this currently on your radar or part of the future roadmap?
Can I make a PR and contribute to this part? If possible, I would like to proceed with this work.
I’ll ensure it works seamlessly with the existing API without breaking changes.

References
[Google Sign-In security bundle docs](https://developers.google.com/identity/siwg/security-bundle)
[Firebase Auth Web Google sign-in docs](https://firebase.google.com/docs/auth/web/google-signin)

### Steps and code to reproduce issue

N/A

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the GoogleAuthProvider entry point and its existing addScope() and setCustomParameters() methods, then trace how signInWithPopup(), signInWithRedirect(), linking, and reauthentication pass provider parameters. Define the provider-level OIDC claims API and verify that claims survive each supported flow without breaking existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
firebase, typescript
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.