@@ -54,14 +54,16 @@ class Credential {
54
54
// / @cond FIREBASE_APP_INTERNAL
55
55
friend class EmailAuthProvider ;
56
56
friend class FacebookAuthProvider ;
57
+ friend class GameCenterAuthProvider ;
57
58
friend class GitHubAuthProvider ;
58
59
friend class GoogleAuthProvider ;
59
60
friend class JniAuthPhoneListener ;
61
+ friend class MicrosoftAuthProvider ;
60
62
friend class OAuthProvider ;
61
63
friend class PhoneAuthProvider ;
62
64
friend class PlayGamesAuthProvider ;
63
65
friend class TwitterAuthProvider ;
64
- friend class GameCenterAuthProvider ;
66
+ friend class YahooAuthProvider ;
65
67
// / @endcond
66
68
#endif // !SWIG
67
69
@@ -131,6 +133,9 @@ class EmailAuthProvider {
131
133
// /
132
134
// / @returns New Credential.
133
135
static Credential GetCredential (const char * email, const char * password);
136
+
137
+ // / The string used to identify this provider.
138
+ static const char * const kProviderId ;
134
139
};
135
140
136
141
// / @brief Use an access token provided by Facebook to authenticate.
@@ -143,10 +148,30 @@ class FacebookAuthProvider {
143
148
// / @returns New Credential.
144
149
static Credential GetCredential (const char * access_token);
145
150
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 ;
150
175
};
151
176
152
177
// / @brief Use an access token provided by GitHub to authenticate.
@@ -159,10 +184,8 @@ class GitHubAuthProvider {
159
184
// / @returns New Credential.
160
185
static Credential GetCredential (const char * token);
161
186
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 ;
166
189
};
167
190
168
191
// / @brief Use an ID token and access token provided by Google to authenticate.
@@ -177,62 +200,17 @@ class GoogleAuthProvider {
177
200
static Credential GetCredential (const char * id_token,
178
201
const char * access_token);
179
202
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 ;
217
205
};
218
206
219
207
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
208
// / @brief Use an access token provided by Microsoft to authenticate.
229
209
class MicrosoftAuthProvider {
230
210
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 ;
233
213
};
234
- #endif // INTERNAL_EXPERIMENTAL
235
-
236
214
237
215
// / @brief OAuth2.0+UserInfo auth provider (OIDC compliant and non-compliant).
238
216
class OAuthProvider {
@@ -248,25 +226,6 @@ class OAuthProvider {
248
226
const char * access_token);
249
227
};
250
228
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
-
270
229
// / @brief Use phone number text messages to authenticate.
271
230
// /
272
231
// / Allows developers to use the phone number and SMS verification codes
@@ -595,6 +554,9 @@ class PhoneAuthProvider {
595
554
// / PhoneAuthProvider.
596
555
static PhoneAuthProvider& GetInstance (Auth* auth);
597
556
557
+ // / The string used to identify this provider.
558
+ static const char * const kProviderId ;
559
+
598
560
private:
599
561
friend struct AuthData ;
600
562
friend class JniAuthPhoneListener ;
@@ -608,6 +570,44 @@ class PhoneAuthProvider {
608
570
PhoneAuthProviderData* data_;
609
571
};
610
572
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
+
611
611
} // namespace auth
612
612
} // namespace firebase
613
613
0 commit comments