Search AD users through Cognito in Spring Boot

51 views Asked by At

I have Cognito setup to authenticate ADFS users. The Cognito's user pool is empty for now. All users and roles reside in AD. In this case, is it possible to list or search users from Active Directory (AD) by using the Cognito API in Spring Boot? If not, is there any approach to do this?

Thanks

1

There are 1 answers

0
Ermiya Eskandary On

No, you can't list Microsoft Active Directory (AD) users via Cognito APIs.

They're designed to interact directly with the user pools in Cognito, not with various federated identity providers like MSFT AD.

In Java, take a look at using the Microsoft Graph SDK, for Java and the provided example on how to list members:

GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider(authProvider).buildClient();

DirectoryObjectCollectionWithReferencesPage members = graphClient.directory().administrativeUnits("8a07f5a8-edc9-4847-bbf2-dde106594bf4").members()
    .buildRequest()
    .get();