sk19810
sk19810

Reputation: 1

SAML based SSO for Authentication and LDAP for authorization - Spring Boot Security

Using Gsuite with Cloud Identity Premium

a) Initialized GSuite as iDP as SAML app for SSO b) Secure LDAP client for reading user information and group information for authorization.

Really confused how to register LDAP client (as authorization provider) along with SAML SSO (authentication provider).

Upvotes: 0

Views: 695

Answers (1)

Jakka NSK
Jakka NSK

Reputation: 111

Use application.properties/application.yml to set properties

spring:
    ldap:
        urls: ldap://<address>:<port>
        base: <baseDN>
        username: <userDN>
        password: <password>
        pooled: true

Use a config class to define a bean with above properties

@Bean
public LdapContextSource contextSource() {
    LdapContextSource ctx = new LdapContextSource();
    ctx.setUrl(urls);
    ctx.setUserDn(username);
    ctx.setPassword(password);
    ctx.setPooled(pooled);
    ctx.afterPropertiesSet();
    return ctx;
}

Now build a LdapQuery and search using LdapTemplate

Upvotes: 0

Related Questions