29
29
import com .google .firebase .FirebaseApp ;
30
30
import com .google .firebase .auth .FirebaseUserManager .EmailLinkType ;
31
31
import com .google .firebase .auth .FirebaseUserManager .UserImportRequest ;
32
+ import com .google .firebase .auth .ListProviderConfigsPage ;
33
+ import com .google .firebase .auth .ListProviderConfigsPage .DefaultOidcProviderConfigSource ;
34
+ import com .google .firebase .auth .ListUsersPage ;
32
35
import com .google .firebase .auth .ListUsersPage .DefaultUserSource ;
33
- import com .google .firebase .auth .ListUsersPage .PageFactory ;
34
36
import com .google .firebase .auth .UserRecord ;
35
37
import com .google .firebase .auth .internal .FirebaseTokenFactory ;
36
38
import com .google .firebase .internal .CallableOperation ;
@@ -503,8 +505,8 @@ private CallableOperation<ListUsersPage, FirebaseAuthException> listUsersOp(
503
505
@ Nullable final String pageToken , final int maxResults ) {
504
506
checkNotDestroyed ();
505
507
final FirebaseUserManager userManager = getUserManager ();
506
- final PageFactory factory =
507
- new PageFactory ( new DefaultUserSource ( userManager , jsonFactory ) , maxResults , pageToken );
508
+ final DefaultUserSource source = new DefaultUserSource ( userManager , jsonFactory );
509
+ final ListUsersPage . Factory factory = new ListUsersPage . Factory ( source , maxResults , pageToken );
508
510
return new CallableOperation <ListUsersPage , FirebaseAuthException >() {
509
511
@ Override
510
512
protected ListUsersPage execute () throws FirebaseAuthException {
@@ -1170,6 +1172,7 @@ public OidcProviderConfig getOidcProviderConfig(@NonNull String providerId)
1170
1172
1171
1173
/**
1172
1174
* Similar to {@link #getOidcProviderConfig(String)} but performs the operation asynchronously.
1175
+ * Page size will be limited to 100 provider configs.
1173
1176
*
1174
1177
* @param providerId A provider ID string.
1175
1178
* @return An {@code ApiFuture} which will complete successfully with an
@@ -1195,6 +1198,78 @@ protected OidcProviderConfig execute() throws FirebaseAuthException {
1195
1198
};
1196
1199
}
1197
1200
1201
+ /**
1202
+ * Gets a page of OIDC Auth provider configs starting from the specified {@code pageToken}.
1203
+ *
1204
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1205
+ * configs.
1206
+ * @param maxResults Maximum number of provider configs to include in the returned page. This may
1207
+ * not exceed 100.
1208
+ * @return A {@link ListProviderConfigsPage} instance.
1209
+ * @throws IllegalArgumentException If the specified page token is empty, or max results value is
1210
+ * invalid.
1211
+ * @throws FirebaseAuthException If an error occurs while retrieving user data.
1212
+ */
1213
+ public ListProviderConfigsPage <OidcProviderConfig > listOidcProviderConfigs (
1214
+ @ Nullable String pageToken , int maxResults ) throws FirebaseAuthException {
1215
+ return listOidcProviderConfigsOp (pageToken , maxResults ).call ();
1216
+ }
1217
+
1218
+ /**
1219
+ * Similar to {@link #listlistOidcProviderConfigs(String)} but performs the operation
1220
+ * asynchronously. Page size will be limited to 100 provider configs.
1221
+ *
1222
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1223
+ * configs.
1224
+ * @return An {@code ApiFuture} which will complete successfully with a
1225
+ * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider
1226
+ * config data, the future throws an exception.
1227
+ * @throws IllegalArgumentException If the specified page token is empty.
1228
+ */
1229
+ public ApiFuture <ListProviderConfigsPage <OidcProviderConfig >> listOidcProviderConfigsAsync (
1230
+ @ Nullable String pageToken ) {
1231
+ return listOidcProviderConfigsAsync (
1232
+ pageToken ,
1233
+ FirebaseUserManager .MAX_LIST_PROVIDER_CONFIGS_RESULTS );
1234
+ }
1235
+
1236
+ /**
1237
+ * Similar to {@link #listOidcProviderConfigs(String, int)} but performs the operation
1238
+ * asynchronously.
1239
+ *
1240
+ * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
1241
+ * configs.
1242
+ * @param maxResults Maximum number of provider configs to include in the returned page. This may
1243
+ * not exceed 100.
1244
+ * @return An {@code ApiFuture} which will complete successfully with a
1245
+ * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider
1246
+ * config data, the future throws an exception.
1247
+ * @throws IllegalArgumentException If the specified page token is empty, or max results value is
1248
+ * invalid.
1249
+ */
1250
+ public ApiFuture <ListProviderConfigsPage <OidcProviderConfig >> listOidcProviderConfigsAsync (
1251
+ @ Nullable String pageToken ,
1252
+ int maxResults ) {
1253
+ return listOidcProviderConfigsOp (pageToken , maxResults ).callAsync (firebaseApp );
1254
+ }
1255
+
1256
+ private CallableOperation <ListProviderConfigsPage <OidcProviderConfig >, FirebaseAuthException >
1257
+ listOidcProviderConfigsOp (@ Nullable final String pageToken , final int maxResults ) {
1258
+ checkNotDestroyed ();
1259
+ final FirebaseUserManager userManager = getUserManager ();
1260
+ final DefaultOidcProviderConfigSource source = new DefaultOidcProviderConfigSource (userManager );
1261
+ final ListProviderConfigsPage .Factory <OidcProviderConfig > factory =
1262
+ new ListProviderConfigsPage .Factory <OidcProviderConfig >(source , maxResults , pageToken );
1263
+ return
1264
+ new CallableOperation <ListProviderConfigsPage <OidcProviderConfig >, FirebaseAuthException >() {
1265
+ @ Override
1266
+ protected ListProviderConfigsPage <OidcProviderConfig > execute ()
1267
+ throws FirebaseAuthException {
1268
+ return factory .create ();
1269
+ }
1270
+ };
1271
+ }
1272
+
1198
1273
/**
1199
1274
* Deletes the provider config identified by the specified provider ID.
1200
1275
*
0 commit comments