Skip to content

Commit bae6be9

Browse files
Googlera-maurice
authored andcommitted
Rework GetProviderId methods to align with API review, which specifies them as "kProviderId " in C++ and ProviderId in C#. go/firebase-idp-cpp-unity
PiperOrigin-RevId: 275110516
1 parent 8ec7e64 commit bae6be9

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed

auth/src/include/firebase/auth/credential.h

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,8 @@ class FacebookAuthProvider {
144144
static Credential GetCredential(const char* access_token);
145145

146146
#ifdef INTERNAL_EXPERIMENTAL
147-
/// Return the providerId used for FederatedAuth.
148-
///
149-
/// @return A string representation of the FacebookAuthProvider.
150-
/// @see FederatedAuthProvider::SetProviderData
151-
/// @see Auth::SignInWithProvider
152-
/// @see User::ReauthenticateWithProvider
153-
/// @see User::LinkWithProvider
154-
static const char* GetProviderId() { return "facebook.com"; }
147+
/// The provider id string used for FederatedAuth.
148+
static constexpr const char* const kProviderId = "facebook.com";
155149
#endif // INTERNAL_EXPERIMENTAL
156150
};
157151

@@ -166,14 +160,8 @@ class GitHubAuthProvider {
166160
static Credential GetCredential(const char* token);
167161

168162
#ifdef INTERNAL_EXPERIMENTAL
169-
/// Return the providerId used for FederatedAuth.
170-
///
171-
/// @return A string representation of the FacebookAuthProvider.
172-
/// @see FederatedAuthProvider::SetProviderData
173-
/// @see Auth::SignInWithProvider
174-
/// @see User::ReauthenticateWithProvider
175-
/// @see User::LinkWithProvider
176-
static const char* GetProviderId() { return "github.com"; }
163+
/// The provider id string used for FederatedAuth.
164+
constexpr static const char* const kProviderId = "github.com";
177165
#endif // INTERNAL_EXPERIMENTAL
178166
};
179167

@@ -190,14 +178,8 @@ class GoogleAuthProvider {
190178
const char* access_token);
191179

192180
#ifdef INTERNAL_EXPERIMENTAL
193-
/// Return the providerId used for FederatedAuth.
194-
///
195-
/// @return A string representation of the FacebookAuthProvider.
196-
/// @see FederatedAuthProvider::SetProviderData
197-
/// @see Auth::SignInWithProvider
198-
/// @see User::ReauthenticateWithProvider
199-
/// @see User::LinkWithProvider
200-
static const char* GetProviderId() { return "google.com"; }
181+
/// The provider id string used for FederatedAuth.
182+
constexpr static const char* const kProviderId = "google.com";
201183
#endif // INTERNAL_EXPERIMENTAL
202184
};
203185

@@ -212,14 +194,8 @@ class PlayGamesAuthProvider {
212194
static Credential GetCredential(const char* server_auth_code);
213195

214196
#ifdef INTERNAL_EXPERIMENTAL
215-
/// Return the providerId used for FederatedAuth.
216-
///
217-
/// @return A string representation of the FacebookAuthProvider.
218-
/// @see FederatedAuthProvider::SetProviderData
219-
/// @see Auth::SignInWithProvider
220-
/// @see User::ReauthenticateWithProvider
221-
/// @see User::LinkWithProvider
222-
static const char* GetProviderId() { return "playgames.google.com"; }
197+
/// The provider id string used for FederatedAuth.
198+
constexpr static const char* const kProviderId = "playgames.google.com";
223199
#endif // INTERNAL_EXPERIMENTAL
224200
};
225201

@@ -235,17 +211,29 @@ class TwitterAuthProvider {
235211
static Credential GetCredential(const char* token, const char* secret);
236212

237213
#ifdef INTERNAL_EXPERIMENTAL
238-
/// Return the providerId used for FederatedAuth.
239-
///
240-
/// @return A string representation of the FacebookAuthProvider.
241-
/// @see FederatedAuthProvider::SetProviderData
242-
/// @see Auth::SignInWithProvider
243-
/// @see User::ReauthenticateWithProvider
244-
/// @see User::LinkWithProvider
245-
static const char* GetProviderId() { return "twitter.com"; }
214+
/// The provider id string used for FederatedAuth.
215+
constexpr static const char* const kProviderId = "twitter.com";
246216
#endif // INTERNAL_EXPERIMENTAL
247217
};
248218

219+
220+
#ifdef INTERNAL_EXPERIMENTAL
221+
/// @brief Use an access token provided by Yahoo to authenticate.
222+
class YahooAuthProvider {
223+
public:
224+
/// The provider id string used for FederatedAuth.
225+
constexpr static const char* const kProviderId = "yahoo.com";
226+
};
227+
228+
/// @brief Use an access token provided by Microsoft to authenticate.
229+
class MicrosoftAuthProvider {
230+
public:
231+
/// The provider id string used for FederatedAuth.
232+
constexpr static const char* const kProviderId = "microsoft.com";
233+
};
234+
#endif // INTERNAL_EXPERIMENTAL
235+
236+
249237
/// @brief OAuth2.0+UserInfo auth provider (OIDC compliant and non-compliant).
250238
class OAuthProvider {
251239
public:

0 commit comments

Comments
 (0)