@@ -236,6 +236,38 @@ describe('auth() -> Providers', function () {
236236 'At least one of ID token and access token must be non-null' ,
237237 ) ;
238238 } ) ;
239+
240+ it ( 'should accept id-token-only credentials (Credential Manager)' , function ( ) {
241+ const { GoogleAuthProvider } = authModular ;
242+
243+ const token = 'google-id-token-only' ;
244+ const credential = GoogleAuthProvider . credential ( token , null ) ;
245+ credential . providerId . should . equal ( 'google.com' ) ;
246+ credential . signInMethod . should . equal ( 'google.com' ) ;
247+ credential . token . should . equal ( token ) ;
248+ credential . secret . should . equal ( '' ) ;
249+ credential . idToken . should . equal ( token ) ;
250+ should . equal ( credential . accessToken , undefined ) ;
251+ } ) ;
252+
253+ it ( 'should reach Android native signInWithCredential for id-token-only Google credentials' , async function ( ) {
254+ if ( ! Platform . android ) {
255+ this . skip ( ) ;
256+ }
257+ const { getApp } = modular ;
258+ const { GoogleAuthProvider, signInWithCredential, getAuth } = authModular ;
259+ const defaultAuth = getAuth ( getApp ( ) ) ;
260+ const credential = GoogleAuthProvider . credential ( 'google-id-token-only-e2e' , null ) ;
261+
262+ try {
263+ await signInWithCredential ( defaultAuth , credential ) ;
264+ throw new Error ( 'Did not error.' ) ;
265+ } catch ( error ) {
266+ error . code . should . be . a . String ( ) ;
267+ error . code . should . not . equal ( 'auth/unknown' ) ;
268+ String ( error . message ) . should . not . match ( / a c c e s s T o k e n c a n n o t b e e m p t y / i) ;
269+ }
270+ } ) ;
239271 } ) ;
240272
241273 describe ( 'GOOGLE_SIGN_IN_METHOD' , function ( ) {
0 commit comments