# Configure Keycloak to authenticate with AD Client Secrets

**URL:** <https://forum.keycloak.org/t/configure-keycloak-to-authenticate-with-ad-client-secrets/5659>\
**Category:** Configuring the server\
**Tags:** authentication, ldap\
**Created:** [October 29, 2020, 11:06am UTC](https://forum.keycloak.org/t/configure-keycloak-to-authenticate-with-ad-client-secrets/5659 "2020-10-29T11:06:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian.kozub](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@sebastian.kozub](https://forum.keycloak.org/u/sebastian.kozub)\
**Post date:** [October 29, 2020, 11:06am UTC](https://forum.keycloak.org/t/configure-keycloak-to-authenticate-with-ad-client-secrets/5659/1 "2020-10-29T11:06:42Z")

</div>

I would like to configure KeyCloak to authenticate some application based on the Client Secret given in AD without standard user/password way but I cannot find any information on this.  
Is it possible? How can I achieve that?

 ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/7/73e8cc9e02e49048a0e6648bb2e71c774e04f471.jpeg)

---

<div class="post-metadata">

**Author:** ![pkadian](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/pkadian/32/1354_2.png) [@pkadian](https://forum.keycloak.org/u/pkadian)\
**Post date:** [October 30, 2020, 4:36am UTC](https://forum.keycloak.org/t/configure-keycloak-to-authenticate-with-ad-client-secrets/5659/2 "2020-10-30T04:36:15Z")

</div>

@sebastian.kozub,

Yes, you can implement using the service account in keycloak. You create a new client and and change its type to service account with assigning management dedicated role to the client. Before this AD should provide restapi to get user details otherwise it is not possible. May be this link will help you.

> **[Securing Applications and Services Guide](https://www.keycloak.org/docs/latest/securing_apps/#_client_registration)**

---

<div class="post-metadata">

**Author:** ![sebastian.kozub](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@sebastian.kozub](https://forum.keycloak.org/u/sebastian.kozub)\
**Post date:** [November 9, 2020, 10:25am UTC](https://forum.keycloak.org/t/configure-keycloak-to-authenticate-with-ad-client-secrets/5659/3 "2020-11-09T10:25:56Z")

</div>

@pkadian

Yes, everything looks logical and clear but is there a way to import secret and id of client application registered in AD together with users? How the client secret and id set by AD impact Keycloak?
