Skip to content

Commit a77e90f

Browse files
committed
Added SignInWithOAuthTwitterTokenAsync
1 parent 1e05553 commit a77e90f

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/Firebase.Auth/FirebaseAuthProvider.cs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,28 @@ public async Task<FirebaseAuthLink> SignInWithOAuthAsync(FirebaseAuthType authTy
105105
return await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
106106
}
107107

108-
/// <summary>
109-
/// Using the provided Id token from google signin, get the firebase auth with token and basic user credentials.
110-
/// </summary>
111-
/// <param name="authType"> The auth type. </param>
112-
/// <param name="idToken"> The Id token retrieved from google signin </param>
113-
/// <returns> The <see cref="FirebaseAuth"/>. </returns>
114-
public async Task<FirebaseAuthLink> SignInWithGoogleIdTokenAsync(string idToken)
108+
/// <summary>
109+
/// Using the provided Id token from google signin, get the firebase auth with token and basic user credentials.
110+
/// </summary>
111+
/// <param name="authType"> The auth type. </param>
112+
/// <param name="oauthAccessToken"> The access token retrieved from twitter. </param>
113+
/// <param name="oauthAccessToken"> The access token secret supplied by twitter. </param>
114+
/// <returns> The <see cref="FirebaseAuth"/>. </returns>
115+
public async Task<FirebaseAuthLink> SignInWithOAuthTwitterTokenAsync(string oauthAccessToken, string oauthTokenSecret)
116+
{
117+
var providerId = this.GetProviderId(FirebaseAuthType.Twitter);
118+
var content = $"{{\"postBody\":\"access_token={oauthAccessToken}&oauth_token_secret={oauthTokenSecret}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnSecureToken\":true}}";
119+
120+
return await this.ExecuteWithPostContentAsync(GoogleIdentityUrl, content).ConfigureAwait(false);
121+
}
122+
123+
/// <summary>
124+
/// Using the provided Id token from google signin, get the firebase auth with token and basic user credentials.
125+
/// </summary>
126+
/// <param name="authType"> The auth type. </param>
127+
/// <param name="idToken"> The Id token retrieved from google signin </param>
128+
/// <returns> The <see cref="FirebaseAuth"/>. </returns>
129+
public async Task<FirebaseAuthLink> SignInWithGoogleIdTokenAsync(string idToken)
115130
{
116131
var providerId = this.GetProviderId(FirebaseAuthType.Google);
117132
var content = $"{{\"postBody\":\"id_token={idToken}&providerId={providerId}\",\"requestUri\":\"http://localhost\",\"returnSecureToken\":true}}";

0 commit comments

Comments
 (0)