Support multiple audience client IDs in idToken validator #2247
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
I was going through the idToken validation docs here: https://developers.google.com/identity/sign-in/web/backend-auth and all the code examples suggest that there is a possibility of multiple clientIDs (aka audience) validation, i.e. in Java:
GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory) // Specify the CLIENT_ID of the app that accesses the backend: .setAudience(Collections.singletonList(CLIENT_ID)) // Or, if multiple clients access the backend: //.setAudience(Arrays.asList(CLIENT_ID_1, CLIENT_ID_2, CLIENT_ID_3)) .build();
This seems not to be supported by the Golaang client:
func (v *Validator) validate(ctx context.Context, idToken string, audience string) (*Payload, error)
if audience != "" && payload.Audience != audience { return nil, fmt.Errorf("idtoken: audience provided does not match aud claim in the JWT" }
I see 2 possible options of such implementation:
The text was updated successfully, but these errors were encountered: