Add Spring LDAP Samples
This commit is contained in:
35
servlet/spring-boot/java/boot/README.adoc
Normal file
35
servlet/spring-boot/java/boot/README.adoc
Normal file
@@ -0,0 +1,35 @@
|
||||
A Hello World Spring LDAP application using Spring Boot
|
||||
|
||||
The application is protected by Spring Security and uses an embedded UnboundID container for its LDAP server.
|
||||
|
||||
You can authenticate with HTTP basic using `bob`/`bobspassword`:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
curl --user bob:bobspassword localhost:8080
|
||||
----
|
||||
|
||||
And you should see the response:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
Hello, bob
|
||||
----
|
||||
|
||||
Also, you can hit the `cn` endpoint which uses `LdapTemplate` to query the datastore for the user's `cn` attribute value, like so:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
curl --user bob:bobspassword localhost:8080/cn
|
||||
----
|
||||
|
||||
This should result in:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
[
|
||||
"Bob Hamilton"
|
||||
]
|
||||
----
|
||||
|
||||
To run the example, do `./gradlew :bootRun`.
|
||||
Reference in New Issue
Block a user