Spring restful services with LDAP authentication - spring

I'm new on Spring framework and I'm trying to create a restful service with LDAP authentication.
For the start, I followed these 2 tutorials on Spring website :
-https://spring.io/guides/gs/rest-service/
-https://spring.io/guides/gs/authenticating-ldap/
Now I want to create a new service which needs the LDAP authentication but I'm stuck. On the LDAP tutorial it's for a Spring application with user interface.
Me I want to call the service with a username/password or token and then executed the service.
Some services will need the authentication and some not.
Can anyone help me ?
Thank you

Related

Is there a Spring boot SAML client for integrating SAML with spring boot application?

I am developing a spring boot application that integrates with multiple Idp's. I have checked many examples over the internet on integrating Spring application with SAML, all of them show how to integrate with IDP's via application properties.
In the case of OAuth 2.0, we had Clients provided by MSAL libraries, we integrated as below.
ConfidentialClientApplication
.builder(decryptCredential(adClientId), clientSecret)
.authority(authorityURL).build();
clientApplication.getAuthorizationRequestUrl(parameters).toString();
clientApplication.acquireToken(authorizationCodeParameters);
Is there a similar way in Spring boot, to have a Client call to ADFS SAMLIDP and get the user authenticated?
Based on the request, fetch IDP details from Database and invoke a call to the appropriate IDP to get the user authenticated.
thanks in advance.
I explored coveooss library, which has clients and it is easiest one to invoke ADFS to fetch SAML assertions. Here is the link for COVEOOSS git link

Service to Service Authentication with Keycloak

I am trying to use Keycloak as Identity Access Management. Creating client & authenticating user is quite okay between Spring Boot and Keycloak. What I am trying to do is authentication and authorization between Spring Boot microservices. The scenario is as follow.
There are two microservices: service A and service B.
Service A has one non-authenticated api route (api 1) which needs to communicate with authenticated api (api 2) on service B.
Api 2 would like to know which services are requesting and have certain access.
I have tried using service account and search online but no luck with Keycloak. :(
Please help me. Thanks

Client Application using Basic Auth with Spring Security and Keycloak

I have an architecture where my user application wants to use a basic authentication when accessing a spring service. This service has to use a Keycloak instance to verify the user/pass of the user application. I don't succeed to configure it (and don't know if its possible).
Yes, it is possible. Keycloak has Spring Security adapter that can be configured for Client and/or Resource Server.
https://www.keycloak.org/docs/latest/securing_apps/index.html#_spring_security_adapter
And also a working example here:
https://github.com/keycloak/keycloak-quickstarts/tree/latest/app-authz-spring-security

How can I integrate spring security with rest oauth2 services and spring social?

I have an app (A) exposing REST services secured with oauth2. (spring security oauth2/spring-web)
I want to create a second app (B) (spring-boot or normal spring), from where I can login then call the REST services from A.
How can I configure security in app B so I can use both social login (facebook, twitter, google) and call REST services from app A? Is there an example using spring security/oauth/social integration?
I've found some examples but none sais how to integrate them
Have you tries the Spring oAuth2 tutorial with FB and Google login? This also includes a local login. All code is available in git from the link in the right column of the tutorial.

Spring Security - OAuth, LDAP Integration for multitenant application

I am using spring security for my spring multitenant application. I am using spring security 3.2
I am using spring security for my spring multitenant application. My requirement
is tenant1 should be authorized against oauth and tenant2 should be authorized
against ldap and tenant3 should be authorized against database. I will be knowing
the authorization method for the tenant through properties file. I am able to
authorize user against any single authorization method. But i am not able to
configure for multiple authorization methods. Please someone give any suggestions
on this.
In case of web application, you can use different login URLs and allow user to choose authentication method. Then separate security filters should be applied for each URL.
You can check this configuration: https://code.google.com/p/opendatakit/source/browse/eclipse-aggregate-gae/war/WEB-INF/applicationContext-security.xml?repo=aggregate

Resources