|
31 | 31 | import com.google.firebase.auth.FirebaseUserManager.UserImportRequest;
|
32 | 32 | import com.google.firebase.auth.ListProviderConfigsPage;
|
33 | 33 | import com.google.firebase.auth.ListProviderConfigsPage.DefaultOidcProviderConfigSource;
|
| 34 | +import com.google.firebase.auth.ListProviderConfigsPage.DefaultSamlProviderConfigSource; |
34 | 35 | import com.google.firebase.auth.ListUsersPage;
|
35 | 36 | import com.google.firebase.auth.ListUsersPage.DefaultUserSource;
|
36 | 37 | import com.google.firebase.auth.UserRecord;
|
@@ -1107,8 +1108,8 @@ public ListProviderConfigsPage<OidcProviderConfig> listOidcProviderConfigs(
|
1107 | 1108 | }
|
1108 | 1109 |
|
1109 | 1110 | /**
|
1110 |
| - * Similar to {@link #listlistOidcProviderConfigs(String)} but performs the operation |
1111 |
| - * asynchronously. Page size will be limited to 100 provider configs. |
| 1111 | + * Similar to {@link #listOidcProviderConfigs(String)} but performs the operation asynchronously. |
| 1112 | + * Page size will be limited to 100 provider configs. |
1112 | 1113 | *
|
1113 | 1114 | * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
|
1114 | 1115 | * configs.
|
@@ -1249,7 +1250,7 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1249 | 1250 |
|
1250 | 1251 | /**
|
1251 | 1252 | * Updates an existing SAML Auth provider config with the attributes contained in the specified
|
1252 |
| - * {@link OidcProviderConfig.UpdateRequest}. |
| 1253 | + * {@link SamlProviderConfig.UpdateRequest}. |
1253 | 1254 | *
|
1254 | 1255 | * @param request A non-null {@link SamlProviderConfig.UpdateRequest} instance.
|
1255 | 1256 | * @return A {@link SamlProviderConfig} instance corresponding to the updated provider config.
|
@@ -1296,7 +1297,7 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1296 | 1297 | * Gets the SAML provider Auth config corresponding to the specified provider ID.
|
1297 | 1298 | *
|
1298 | 1299 | * @param providerId A provider ID string.
|
1299 |
| - * @return An {@link OidcProviderConfig} instance. |
| 1300 | + * @return An {@link SamlProviderConfig} instance. |
1300 | 1301 | * @throws IllegalArgumentException If the provider ID string is null or empty, or is not prefixed
|
1301 | 1302 | * with 'saml'.
|
1302 | 1303 | * @throws FirebaseAuthException If an error occurs while retrieving the provider config.
|
@@ -1335,6 +1336,94 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1335 | 1336 | };
|
1336 | 1337 | }
|
1337 | 1338 |
|
| 1339 | + /** |
| 1340 | + * Gets a page of SAML Auth provider configs starting from the specified {@code pageToken}. Page |
| 1341 | + * size will be limited to 100 provider configs. |
| 1342 | + * |
| 1343 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1344 | + * configs. |
| 1345 | + * @return A {@link ListProviderConfigsPage} instance. |
| 1346 | + * @throws IllegalArgumentException If the specified page token is empty. |
| 1347 | + * @throws FirebaseAuthException If an error occurs while retrieving provider config data. |
| 1348 | + */ |
| 1349 | + public ListProviderConfigsPage<SamlProviderConfig> listSamlProviderConfigs( |
| 1350 | + @Nullable String pageToken) throws FirebaseAuthException { |
| 1351 | + return listSamlProviderConfigs( |
| 1352 | + pageToken, |
| 1353 | + FirebaseUserManager.MAX_LIST_PROVIDER_CONFIGS_RESULTS); |
| 1354 | + } |
| 1355 | + |
| 1356 | + /** |
| 1357 | + * Gets a page of SAML Auth provider configs starting from the specified {@code pageToken}. |
| 1358 | + * |
| 1359 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1360 | + * configs. |
| 1361 | + * @param maxResults Maximum number of provider configs to include in the returned page. This may |
| 1362 | + * not exceed 100. |
| 1363 | + * @return A {@link ListProviderConfigsPage} instance. |
| 1364 | + * @throws IllegalArgumentException If the specified page token is empty, or max results value is |
| 1365 | + * invalid. |
| 1366 | + * @throws FirebaseAuthException If an error occurs while retrieving provider config data. |
| 1367 | + */ |
| 1368 | + public ListProviderConfigsPage<SamlProviderConfig> listSamlProviderConfigs( |
| 1369 | + @Nullable String pageToken, int maxResults) throws FirebaseAuthException { |
| 1370 | + return listSamlProviderConfigsOp(pageToken, maxResults).call(); |
| 1371 | + } |
| 1372 | + |
| 1373 | + /** |
| 1374 | + * Similar to {@link #listSamlProviderConfigs(String)} but performs the operation asynchronously. |
| 1375 | + * Page size will be limited to 100 provider configs. |
| 1376 | + * |
| 1377 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1378 | + * configs. |
| 1379 | + * @return An {@code ApiFuture} which will complete successfully with a |
| 1380 | + * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider |
| 1381 | + * config data, the future throws an exception. |
| 1382 | + * @throws IllegalArgumentException If the specified page token is empty. |
| 1383 | + */ |
| 1384 | + public ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> listSamlProviderConfigsAsync( |
| 1385 | + @Nullable String pageToken) { |
| 1386 | + int maxResults = FirebaseUserManager.MAX_LIST_PROVIDER_CONFIGS_RESULTS; |
| 1387 | + return listSamlProviderConfigsAsync(pageToken, maxResults); |
| 1388 | + } |
| 1389 | + |
| 1390 | + /** |
| 1391 | + * Similar to {@link #listSamlProviderConfigs(String, int)} but performs the operation |
| 1392 | + * asynchronously. |
| 1393 | + * |
| 1394 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1395 | + * configs. |
| 1396 | + * @param maxResults Maximum number of provider configs to include in the returned page. This may |
| 1397 | + * not exceed 100. |
| 1398 | + * @return An {@code ApiFuture} which will complete successfully with a |
| 1399 | + * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider |
| 1400 | + * config data, the future throws an exception. |
| 1401 | + * @throws IllegalArgumentException If the specified page token is empty, or max results value is |
| 1402 | + * invalid. |
| 1403 | + */ |
| 1404 | + public ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> listSamlProviderConfigsAsync( |
| 1405 | + @Nullable String pageToken, |
| 1406 | + int maxResults) { |
| 1407 | + return listSamlProviderConfigsOp(pageToken, maxResults).callAsync(firebaseApp); |
| 1408 | + } |
| 1409 | + |
| 1410 | + private CallableOperation<ListProviderConfigsPage<SamlProviderConfig>, FirebaseAuthException> |
| 1411 | + listSamlProviderConfigsOp(@Nullable final String pageToken, final int maxResults) { |
| 1412 | + checkNotDestroyed(); |
| 1413 | + final FirebaseUserManager userManager = getUserManager(); |
| 1414 | + final DefaultSamlProviderConfigSource source = new DefaultSamlProviderConfigSource(userManager); |
| 1415 | + final ListProviderConfigsPage.Factory<SamlProviderConfig> factory = |
| 1416 | + new ListProviderConfigsPage.Factory<SamlProviderConfig>(source, maxResults, pageToken); |
| 1417 | + return |
| 1418 | + new CallableOperation<ListProviderConfigsPage<SamlProviderConfig>, FirebaseAuthException>() { |
| 1419 | + @Override |
| 1420 | + protected ListProviderConfigsPage<SamlProviderConfig> execute() |
| 1421 | + throws FirebaseAuthException { |
| 1422 | + return factory.create(); |
| 1423 | + } |
| 1424 | + }; |
| 1425 | + } |
| 1426 | + |
1338 | 1427 | /**
|
1339 | 1428 | * Deletes the SAML Auth provider config identified by the specified provider ID.
|
1340 | 1429 | *
|
|
0 commit comments