@@ -215,7 +215,7 @@ public async Task SendEmailVerificationAsync(FirebaseAuth auth)
215
215
}
216
216
217
217
/// <summary>
218
- /// Links the authenticated user represented by <see cref="auth "/> with an email and password.
218
+ /// Links the given <see cref="firebaseToken "/> with an email and password.
219
219
/// </summary>
220
220
/// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
221
221
/// <param name="email"> The email. </param>
@@ -241,7 +241,7 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(FirebaseAuth auth, string
241
241
}
242
242
243
243
/// <summary>
244
- /// Links the authenticated user represented by <see cref="auth "/> with and account from a third party provider.
244
+ /// Links the given <see cref="firebaseToken "/> with an account from a third party provider.
245
245
/// </summary>
246
246
/// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
247
247
/// <param name="authType"> The auth type. </param>
@@ -256,7 +256,7 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(string firebaseToken, Fire
256
256
}
257
257
258
258
/// <summary>
259
- /// Links the authenticated user represented by <see cref="auth"/> with and account from a third party provider.
259
+ /// Links the authenticated user represented by <see cref="auth"/> with an account from a third party provider.
260
260
/// </summary>
261
261
/// <param name="auth"> The auth. </param>
262
262
/// <param name="authType"> The auth type. </param>
@@ -267,6 +267,40 @@ public async Task<FirebaseAuthLink> LinkAccountsAsync(FirebaseAuth auth, Firebas
267
267
return await this . LinkAccountsAsync ( auth . FirebaseToken , authType , oauthAccessToken ) . ConfigureAwait ( false ) ;
268
268
}
269
269
270
+ /// <summary>
271
+ /// Unlinks the given <see cref="authType"/> from the account associated with <see cref="firebaseToken"/>.
272
+ /// </summary>
273
+ /// <param name="firebaseToken"> The FirebaseToken (idToken) of an authenticated user. </param>
274
+ /// <param name="authType"> The auth type. </param>
275
+ /// <returns> The <see cref="FirebaseAuthLink"/>. </returns>
276
+ public async Task < FirebaseAuthLink > UnlinkAccountsAsync ( string firebaseToken , FirebaseAuthType authType )
277
+ {
278
+ string providerId = null ;
279
+ if ( authType == FirebaseAuthType . EmailAndPassword )
280
+ {
281
+ providerId = authType . ToEnumString ( ) ;
282
+ }
283
+ else
284
+ {
285
+ providerId = this . GetProviderId ( authType ) ;
286
+ }
287
+
288
+ var content = $ "{{\" idToken\" :\" { firebaseToken } \" ,\" deleteProvider\" :[\" { providerId } \" ]}}";
289
+
290
+ return await this . ExecuteWithPostContentAsync ( GoogleSetAccountUrl , content ) . ConfigureAwait ( false ) ;
291
+ }
292
+
293
+ /// <summary>
294
+ /// Unlinks the given <see cref="authType"/> from the authenticated user represented by <see cref="auth"/>.
295
+ /// </summary>
296
+ /// <param name="auth"> The auth. </param>
297
+ /// <param name="authType"> The auth type. </param>
298
+ /// <returns> The <see cref="FirebaseAuthLink"/>. </returns>
299
+ public async Task < FirebaseAuthLink > UnlinkAccountsAsync ( FirebaseAuth auth , FirebaseAuthType authType )
300
+ {
301
+ return await this . UnlinkAccountsAsync ( auth . FirebaseToken , authType ) . ConfigureAwait ( false ) ;
302
+ }
303
+
270
304
/// <summary>
271
305
/// Gets a list of accounts linked to given email.
272
306
/// </summary>
0 commit comments