@@ -54,14 +54,16 @@ class Credential {
5454 // / @cond FIREBASE_APP_INTERNAL
5555 friend class EmailAuthProvider ;
5656 friend class FacebookAuthProvider ;
57+ friend class GameCenterAuthProvider ;
5758 friend class GitHubAuthProvider ;
5859 friend class GoogleAuthProvider ;
5960 friend class JniAuthPhoneListener ;
61+ friend class MicrosoftAuthProvider ;
6062 friend class OAuthProvider ;
6163 friend class PhoneAuthProvider ;
6264 friend class PlayGamesAuthProvider ;
6365 friend class TwitterAuthProvider ;
64- friend class GameCenterAuthProvider ;
66+ friend class YahooAuthProvider ;
6567 // / @endcond
6668#endif // !SWIG
6769
@@ -131,6 +133,9 @@ class EmailAuthProvider {
131133 // /
132134 // / @returns New Credential.
133135 static Credential GetCredential (const char * email, const char * password);
136+
137+ // / The string used to identify this provider.
138+ static const char * const kProviderId ;
134139};
135140
136141// / @brief Use an access token provided by Facebook to authenticate.
@@ -143,10 +148,30 @@ class FacebookAuthProvider {
143148 // / @returns New Credential.
144149 static Credential GetCredential (const char * access_token);
145150
146- #ifdef INTERNAL_EXPERIMENTAL
147- // / The provider id string used for FederatedAuth.
148- static constexpr const char * const kProviderId = " facebook.com" ;
149- #endif // INTERNAL_EXPERIMENTAL
151+ // / The string used to identify this provider.
152+ static const char * const kProviderId ;
153+ };
154+
155+ // / @brief GameCenter (iOS) auth provider
156+ class GameCenterAuthProvider {
157+ public:
158+ // / Generate a credential from GameCenter for the current user.
159+ // /
160+ // / @return a Future that will be fulfilled with the resulting credential.
161+ static Future<Credential> GetCredential ();
162+
163+ // / Get the result of the most recent GetCredential() call.
164+ // /
165+ // / @return an object which can be used to retrieve the Credential.
166+ static Future<Credential> GetCredentialLastResult ();
167+
168+ // / Tests to see if the current user is signed in to GameCenter.
169+ // /
170+ // / @return true if the user is signed in, false otherwise.
171+ static bool IsPlayerAuthenticated ();
172+
173+ // / The string used to identify this provider.
174+ static const char * const kProviderId ;
150175};
151176
152177// / @brief Use an access token provided by GitHub to authenticate.
@@ -159,10 +184,8 @@ class GitHubAuthProvider {
159184 // / @returns New Credential.
160185 static Credential GetCredential (const char * token);
161186
162- #ifdef INTERNAL_EXPERIMENTAL
163- // / The provider id string used for FederatedAuth.
164- constexpr static const char * const kProviderId = " github.com" ;
165- #endif // INTERNAL_EXPERIMENTAL
187+ // / The string used to identify this provider.
188+ static const char * const kProviderId ;
166189};
167190
168191// / @brief Use an ID token and access token provided by Google to authenticate.
@@ -177,62 +200,17 @@ class GoogleAuthProvider {
177200 static Credential GetCredential (const char * id_token,
178201 const char * access_token);
179202
180- #ifdef INTERNAL_EXPERIMENTAL
181- // / The provider id string used for FederatedAuth.
182- constexpr static const char * const kProviderId = " google.com" ;
183- #endif // INTERNAL_EXPERIMENTAL
184- };
185-
186- // / @brief Use a server auth code provided by Google Play Games to authenticate.
187- class PlayGamesAuthProvider {
188- public:
189- // / Generate a credential from the given Server Auth Code.
190- // /
191- // / @param server_auth_code Play Games Sign in Server Auth Code.
192- // /
193- // / @returns New Credential.
194- static Credential GetCredential (const char * server_auth_code);
195-
196- #ifdef INTERNAL_EXPERIMENTAL
197- // / The provider id string used for FederatedAuth.
198- constexpr static const char * const kProviderId = " playgames.google.com" ;
199- #endif // INTERNAL_EXPERIMENTAL
200- };
201-
202- // / @brief Use a token and secret provided by Twitter to authenticate.
203- class TwitterAuthProvider {
204- public:
205- // / Generate a credential from the given Twitter token and password.
206- // /
207- // / @param token The Twitter OAuth token.
208- // / @param secret The Twitter OAuth secret.
209- // /
210- // / @returns New Credential.
211- static Credential GetCredential (const char * token, const char * secret);
212-
213- #ifdef INTERNAL_EXPERIMENTAL
214- // / The provider id string used for FederatedAuth.
215- constexpr static const char * const kProviderId = " twitter.com" ;
216- #endif // INTERNAL_EXPERIMENTAL
203+ // / The string used to identify this provider.
204+ static const char * const kProviderId ;
217205};
218206
219207
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-
228208// / @brief Use an access token provided by Microsoft to authenticate.
229209class MicrosoftAuthProvider {
230210 public:
231- // / The provider id string used for FederatedAuth .
232- constexpr static const char * const kProviderId = " microsoft.com " ;
211+ // / The string used to identify this provider .
212+ static const char * const kProviderId ;
233213};
234- #endif // INTERNAL_EXPERIMENTAL
235-
236214
237215// / @brief OAuth2.0+UserInfo auth provider (OIDC compliant and non-compliant).
238216class OAuthProvider {
@@ -248,25 +226,6 @@ class OAuthProvider {
248226 const char * access_token);
249227};
250228
251- // / @brief GameCenter (iOS) auth provider
252- class GameCenterAuthProvider {
253- public:
254- // / Generate a credential from GameCenter for the current user.
255- // /
256- // / @return a Future that will be fulfilled with the resulting credential.
257- static Future<Credential> GetCredential ();
258-
259- // / Get the result of the most recent GetCredential() call.
260- // /
261- // / @return an object which can be used to retrieve the Credential.
262- static Future<Credential> GetCredentialLastResult ();
263-
264- // / Tests to see if the current user is signed in to GameCenter.
265- // /
266- // / @return true if the user is signed in, false otherwise.
267- static bool IsPlayerAuthenticated ();
268- };
269-
270229// / @brief Use phone number text messages to authenticate.
271230// /
272231// / Allows developers to use the phone number and SMS verification codes
@@ -595,6 +554,9 @@ class PhoneAuthProvider {
595554 // / PhoneAuthProvider.
596555 static PhoneAuthProvider& GetInstance (Auth* auth);
597556
557+ // / The string used to identify this provider.
558+ static const char * const kProviderId ;
559+
598560 private:
599561 friend struct AuthData ;
600562 friend class JniAuthPhoneListener ;
@@ -608,6 +570,44 @@ class PhoneAuthProvider {
608570 PhoneAuthProviderData* data_;
609571};
610572
573+ // / @brief Use a server auth code provided by Google Play Games to authenticate.
574+ class PlayGamesAuthProvider {
575+ public:
576+ // / Generate a credential from the given Server Auth Code.
577+ // /
578+ // / @param server_auth_code Play Games Sign in Server Auth Code.
579+ // /
580+ // / @return New Credential.
581+ static Credential GetCredential (const char * server_auth_code);
582+
583+ // / The string used to identify this provider.
584+ static const char * const kProviderId ;
585+ };
586+
587+ // / @brief Use a token and secret provided by Twitter to authenticate.
588+ class TwitterAuthProvider {
589+ public:
590+ // / Generate a credential from the given Twitter token and password.
591+ // /
592+ // / @param token The Twitter OAuth token.
593+ // / @param secret The Twitter OAuth secret.
594+ // /
595+ // / @return New Credential.
596+ static Credential GetCredential (const char * token, const char * secret);
597+
598+ // / The string used to identify this provider.
599+ static const char * const kProviderId ;
600+ };
601+
602+
603+ // / @brief Use an access token provided by Yahoo to authenticate.
604+ class YahooAuthProvider {
605+ public:
606+ // / The string used to identify this provider.
607+ static const char * const kProviderId ;
608+ };
609+
610+
611611} // namespace auth
612612} // namespace firebase
613613
0 commit comments