|
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;
|
@@ -1244,8 +1245,8 @@ public ListProviderConfigsPage<OidcProviderConfig> listOidcProviderConfigs(
|
1244 | 1245 | }
|
1245 | 1246 |
|
1246 | 1247 | /**
|
1247 |
| - * Similar to {@link #listlistOidcProviderConfigs(String)} but performs the operation |
1248 |
| - * asynchronously. Page size will be limited to 100 provider configs. |
| 1248 | + * Similar to {@link #listOidcProviderConfigs(String)} but performs the operation asynchronously. |
| 1249 | + * Page size will be limited to 100 provider configs. |
1249 | 1250 | *
|
1250 | 1251 | * @param pageToken A non-empty page token string, or null to retrieve the first page of provider
|
1251 | 1252 | * configs.
|
@@ -1386,7 +1387,7 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1386 | 1387 |
|
1387 | 1388 | /**
|
1388 | 1389 | * Updates an existing SAML Auth provider config with the attributes contained in the specified
|
1389 |
| - * {@link OidcProviderConfig.UpdateRequest}. |
| 1390 | + * {@link SamlProviderConfig.UpdateRequest}. |
1390 | 1391 | *
|
1391 | 1392 | * @param request A non-null {@link SamlProviderConfig.UpdateRequest} instance.
|
1392 | 1393 | * @return A {@link SamlProviderConfig} instance corresponding to the updated provider config.
|
@@ -1433,7 +1434,7 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1433 | 1434 | * Gets the SAML provider Auth config corresponding to the specified provider ID.
|
1434 | 1435 | *
|
1435 | 1436 | * @param providerId A provider ID string.
|
1436 |
| - * @return An {@link OidcProviderConfig} instance. |
| 1437 | + * @return An {@link SamlProviderConfig} instance. |
1437 | 1438 | * @throws IllegalArgumentException If the provider ID string is null or empty, or is not prefixed
|
1438 | 1439 | * with 'saml'.
|
1439 | 1440 | * @throws FirebaseAuthException If an error occurs while retrieving the provider config.
|
@@ -1472,6 +1473,94 @@ protected SamlProviderConfig execute() throws FirebaseAuthException {
|
1472 | 1473 | };
|
1473 | 1474 | }
|
1474 | 1475 |
|
| 1476 | + /** |
| 1477 | + * Gets a page of SAML Auth provider configs starting from the specified {@code pageToken}. Page |
| 1478 | + * size will be limited to 100 provider configs. |
| 1479 | + * |
| 1480 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1481 | + * configs. |
| 1482 | + * @return A {@link ListProviderConfigsPage} instance. |
| 1483 | + * @throws IllegalArgumentException If the specified page token is empty. |
| 1484 | + * @throws FirebaseAuthException If an error occurs while retrieving provider config data. |
| 1485 | + */ |
| 1486 | + public ListProviderConfigsPage<SamlProviderConfig> listSamlProviderConfigs( |
| 1487 | + @Nullable String pageToken) throws FirebaseAuthException { |
| 1488 | + return listSamlProviderConfigs( |
| 1489 | + pageToken, |
| 1490 | + FirebaseUserManager.MAX_LIST_PROVIDER_CONFIGS_RESULTS); |
| 1491 | + } |
| 1492 | + |
| 1493 | + /** |
| 1494 | + * Gets a page of SAML Auth provider configs starting from the specified {@code pageToken}. |
| 1495 | + * |
| 1496 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1497 | + * configs. |
| 1498 | + * @param maxResults Maximum number of provider configs to include in the returned page. This may |
| 1499 | + * not exceed 100. |
| 1500 | + * @return A {@link ListProviderConfigsPage} instance. |
| 1501 | + * @throws IllegalArgumentException If the specified page token is empty, or max results value is |
| 1502 | + * invalid. |
| 1503 | + * @throws FirebaseAuthException If an error occurs while retrieving provider config data. |
| 1504 | + */ |
| 1505 | + public ListProviderConfigsPage<SamlProviderConfig> listSamlProviderConfigs( |
| 1506 | + @Nullable String pageToken, int maxResults) throws FirebaseAuthException { |
| 1507 | + return listSamlProviderConfigsOp(pageToken, maxResults).call(); |
| 1508 | + } |
| 1509 | + |
| 1510 | + /** |
| 1511 | + * Similar to {@link #listSamlProviderConfigs(String)} but performs the operation asynchronously. |
| 1512 | + * Page size will be limited to 100 provider configs. |
| 1513 | + * |
| 1514 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1515 | + * configs. |
| 1516 | + * @return An {@code ApiFuture} which will complete successfully with a |
| 1517 | + * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider |
| 1518 | + * config data, the future throws an exception. |
| 1519 | + * @throws IllegalArgumentException If the specified page token is empty. |
| 1520 | + */ |
| 1521 | + public ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> listSamlProviderConfigsAsync( |
| 1522 | + @Nullable String pageToken) { |
| 1523 | + int maxResults = FirebaseUserManager.MAX_LIST_PROVIDER_CONFIGS_RESULTS; |
| 1524 | + return listSamlProviderConfigsAsync(pageToken, maxResults); |
| 1525 | + } |
| 1526 | + |
| 1527 | + /** |
| 1528 | + * Similar to {@link #listSamlProviderConfigs(String, int)} but performs the operation |
| 1529 | + * asynchronously. |
| 1530 | + * |
| 1531 | + * @param pageToken A non-empty page token string, or null to retrieve the first page of provider |
| 1532 | + * configs. |
| 1533 | + * @param maxResults Maximum number of provider configs to include in the returned page. This may |
| 1534 | + * not exceed 100. |
| 1535 | + * @return An {@code ApiFuture} which will complete successfully with a |
| 1536 | + * {@link ListProviderConfigsPage} instance. If an error occurs while retrieving provider |
| 1537 | + * config data, the future throws an exception. |
| 1538 | + * @throws IllegalArgumentException If the specified page token is empty, or max results value is |
| 1539 | + * invalid. |
| 1540 | + */ |
| 1541 | + public ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> listSamlProviderConfigsAsync( |
| 1542 | + @Nullable String pageToken, |
| 1543 | + int maxResults) { |
| 1544 | + return listSamlProviderConfigsOp(pageToken, maxResults).callAsync(firebaseApp); |
| 1545 | + } |
| 1546 | + |
| 1547 | + private CallableOperation<ListProviderConfigsPage<SamlProviderConfig>, FirebaseAuthException> |
| 1548 | + listSamlProviderConfigsOp(@Nullable final String pageToken, final int maxResults) { |
| 1549 | + checkNotDestroyed(); |
| 1550 | + final FirebaseUserManager userManager = getUserManager(); |
| 1551 | + final DefaultSamlProviderConfigSource source = new DefaultSamlProviderConfigSource(userManager); |
| 1552 | + final ListProviderConfigsPage.Factory<SamlProviderConfig> factory = |
| 1553 | + new ListProviderConfigsPage.Factory<SamlProviderConfig>(source, maxResults, pageToken); |
| 1554 | + return |
| 1555 | + new CallableOperation<ListProviderConfigsPage<SamlProviderConfig>, FirebaseAuthException>() { |
| 1556 | + @Override |
| 1557 | + protected ListProviderConfigsPage<SamlProviderConfig> execute() |
| 1558 | + throws FirebaseAuthException { |
| 1559 | + return factory.create(); |
| 1560 | + } |
| 1561 | + }; |
| 1562 | + } |
| 1563 | + |
1475 | 1564 | /**
|
1476 | 1565 | * Deletes the SAML Auth provider config identified by the specified provider ID.
|
1477 | 1566 | *
|
|
0 commit comments