@@ -229,7 +229,7 @@ public async Task SendEmailVerificationAsync(FirebaseAuth auth)
229
229
}
230
230
231
231
/// <summary>
232
- /// Links the authenticated user represented by <see cref="auth "/> with an email and password.
232
+ /// Links the given <see cref="firebaseToken "/> with an email and password.
233
233
/// </summary>
234
234
/// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
235
235
/// <param name="email"> The email. </param>
@@ -255,7 +255,7 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(FirebaseAuth auth, string
255
255
}
256
256
257
257
/// <summary>
258
- /// Links the authenticated user represented by <see cref="auth "/> with and account from a third party provider.
258
+ /// Links the given <see cref="firebaseToken "/> with an account from a third party provider.
259
259
/// </summary>
260
260
/// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
261
261
/// <param name="authType"> The auth type. </param>
@@ -270,7 +270,7 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(string firebaseToken, Fire
270
270
}
271
271
272
272
/// <summary>
273
- /// Links the authenticated user represented by <see cref="auth"/> with and account from a third party provider.
273
+ /// Links the authenticated user represented by <see cref="auth"/> with an account from a third party provider.
274
274
/// </summary>
275
275
/// <param name="auth"> The auth. </param>
276
276
/// <param name="authType"> The auth type. </param>
@@ -281,6 +281,40 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(FirebaseAuth auth, Firebas
281
281
return await this . LinkAccountsAsync ( auth . FirebaseToken , authType , oauthAccessToken ) . ConfigureAwait ( false ) ;
282
282
}
283
283
284
+ /// <summary>
285
+ /// Unlinks the given <see cref="authType"/> from the account associated with <see cref="firebaseToken"/>.
286
+ /// </summary>
287
+ /// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
288
+ /// <param name="authType"> The auth type. </param>
289
+ /// <returns> The <see cref="FirebaseAuthLink"/>. </returns>
290
+ public async Task < FirebaseAuthLink > UnlinkAccountsAsync ( string firebaseToken , FirebaseAuthType authType )
291
+ {
292
+ string providerId = null ;
293
+ if ( authType == FirebaseAuthType . EmailAndPassword )
294
+ {
295
+ providerId = authType . ToEnumString ( ) ;
296
+ }
297
+ else
298
+ {
299
+ providerId = this . GetProviderId ( authType ) ;
300
+ }
301
+
302
+ var content = $ "{{\" idToken\" :\" { firebaseToken } \" ,\" deleteProvider\" :[\" { providerId } \" ]}}";
303
+
304
+ return await this . ExecuteWithPostContentAsync ( GoogleSetAccountUrl , content ) . ConfigureAwait ( false ) ;
305
+ }
306
+
307
+ /// <summary>
308
+ /// Unlinks the given <see cref="authType"/> from the authenticated user represented by <see cref="auth"/>.
309
+ /// </summary>
310
+ /// <param name="auth"> The auth. </param>
311
+ /// <param name="authType"> The auth type. </param>
312
+ /// <returns> The <see cref="FirebaseAuthLink"/>. </returns>
313
+ public async Task < FirebaseAuthLink > UnlinkAccountsAsync ( FirebaseAuth auth , FirebaseAuthType authType )
314
+ {
315
+ return await this . UnlinkAccountsAsync ( auth . FirebaseToken , authType ) . ConfigureAwait ( false ) ;
316
+ }
317
+
284
318
/// <summary>
285
319
/// Gets a list of accounts linked to given email.
286
320
/// </summary>
0 commit comments