# Enabling LDAP basic authentication in CTP

**URL:** <https://techcommunity.softwareag.com/t/enabling-ldap-basic-authentication-in-ctp/244542>\
**Category:** Knowledge base\
**Tags:** LDAP, CTP, basic-auth, WSS\
**Created:** [September 24, 2021, 7:25am UTC](https://techcommunity.softwareag.com/t/enabling-ldap-basic-authentication-in-ctp/244542 "2021-09-24T07:25:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitar\_Kapitanov](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Dimitar\_Kapitanov](https://techcommunity.softwareag.com/u/Dimitar_Kapitanov)\
**Post date:** [September 24, 2021, 7:25am UTC](https://techcommunity.softwareag.com/t/enabling-ldap-basic-authentication-in-ctp/244542/1 "2021-09-24T07:25:29Z")

</div>

Here are the steps to enable LDAP authentication in Software AG Runtime (CTP).

1. In ‘\<SAG\_HOME\>/profiles/CTP/configuration/jaas.config’ file, add your LDAP settings in the beginning:

```auto
LdapRealm { 
    com.softwareag.security.sin.is.ldap.lm.LDAPLoginModule required alias="name3"
    logLevel="DEBUG" 
    logFile="../../profiles/CTP/logs/sin.log" 
    useLog="TRUE" 
    url="<YourLdapServerUrl>" 
    prin="CN=<YourUserName>,OU=User,DC=<YourLdapOrgKeys>"
    cred="<YourLdapPassword>" 
    useaf="false" usecaching="false" 
    creategroups=true 
    gidprop="SAMAccountName" 
    uidprop="SAMAccountName" 
    userrootdn="DC=<YourLdapOrgKeys>" 
    grouprootdn="DC=<YourLdapOrgKeys>"; 
};

```

1. In ‘\<SAG\_HOME\>/profiles/CTP/configuration/tomcat/conf/server.xml’, next line after ‘Realm…’ add:

```auto
 <Realm className="com.softwareag.platform.catalina.auth.SINRealm" name="LdapRealm"/>

```

1. In ‘\<SAG\_HOME\>/profiles/CTP/configuration/tomcat/conf/web.xml’, near the end (just before ‘web-app’ closing element) add:

```auto
<security-constraint>
     <web-resource-collection>
         <web-resource-name>YourServiceName</web-resource-name>
         <url-pattern>/services/YourServiceEndpoint/</url-pattern>
     </web-resource-collection>
     <auth-constraint>
         <role-name>*</role-name>
     </auth-constraint>
 </security-constraint>
 <login-config>
     <auth-method>BASIC</auth-method>
     <realm-name>LdapRealm</realm-name>
 </login-config>
 <security-role>
     <role-name>*</role-name>
 </security-role>

```

The tricky part is the ‘role-name’. The ‘\*’ means any role.
