Adding LDAP configuration using kcadm.bat in Keycloak 15.1.1 throws BAD REQUEST #12378
Unanswered
shubhamarora97
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to add LDAP configuration from kcadm in Keycloak 15.1.1 using the following CLI and getting 400 BAD Request:
Here, LDAP server, Users DN, Bind DN and bindCredentials are correct values from LDAP server
kcadm.bat create components -r admin -s 'name="LDAP"' -s 'providerId="ldap"'-s 'providerType="org.keycloak.storage.UserStorageProvider"' -s 'parentId="ddf5a1a8-12e7-4ab0-ace8-4e4c05e5ce25"' -s 'config.priority=["0"]' -s 'config.fullSyncPeriod=["-1"]' -s 'config.changedSyncPeriod=["86400"]' -s 'config.cachePolicy=["DEFAULT"]' -s config.evictionDay=[] -s config.evictionHour=[] -s config.evictionMinute=[] -s config.maxLifespan=[] -s 'config.batchSizeForSync=["1000"]' -s 'config.editMode=["READ_ONLY"]' -s 'config.syncRegistrations=["false"]' -s 'config.vendor=["ad"]' -s 'config.usernameLDAPAttribute=["cn"]' -s 'config.rdnLDAPAttribute=["cn"]' -s 'config.uuidLDAPAttribute=["objectGUID"]' -s 'config.userObjectClasses=["person, organizationalPerson, user"]' -s 'config.connectionUrl=["ldaps://LDAP:636"]' -s 'config.usersDn=["CN=Users,DC=testing,DC=net"]' -s 'config.authType=["simple"]' -s 'config.bindDn=["CN=testuser,CN=Users,DC=testing,DC=net"]' -s 'config.bindCredential=["test"]' -s 'config.searchScope=["1"]' -s 'config.useTruststoreSpi=["ldapsOnly"]' -s 'config.connectionPooling=["true"]' -s 'config.pagination=["true"]' -s 'config.allowKerberosAuthentication=["false"]' -s 'config.serverPrincipal=[]' -s 'config.keyTab=[]' -s 'config.kerberosRealm=[]' -s 'config.debug=["false"]' -s 'config.useKerberosForPasswordAuthentication=["false"]'
I enabled Requestdumping and after that I can see the following API is throwing 400 BAD REQUEST: Here, I am not able to check the request body being passed to this API and if thatis causing any issue.
INFO [RequestDumpingHandler$1:150:default task-5]
----------------------------REQUEST---------------------------
URI=/auth/admin/realms/admin/components
characterEncoding=null
contentLength=-1
contentType=[application/json]
header=Accept=application/json
header=Connection=Keep-Alive
header=Authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3XzE2T0J3RldhUUZnblh6Z2lKY19wOGVJa3J3UEVPdjB1cmo5b2liN0RNIn0.eyJleHAiOjE2NTQ1OTQ1NDAsImlhdCI6MTY1NDU5Mjc0MCwianRpIjoiNTM5NGVjYjctYzAxYy00NmRjLTk0ZDgtMTlkZDliMjc5ODhjIiwiaXNzIjoiaHR0cHM6Ly9pd2YwMjIxOTEuaHBlc3dsYWIubmV0OjcxMTYvYXV0aC9yZWFsbXMvRGF0YVByb3RlY3RvciIsInN1YiI6IjhlNTcwYTNmLTMyYjktNDA4ZC05NGMxLTkyODU1Y2Y5NmQ0NSIsInR5cCI6IkJlYXJlciIsImF6cCI6ImFkbWluLWNsaSIsInNlc3Npb25fc3RhdGUiOiIwYTFkMWU4ZS1kN2M3LTRjYWQtOTYzNC00YWM1OWJkYTEyMDkiLCJhY3IiOiIxIiwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwic2lkIjoiMGExZDFlOGUtZDdjNy00Y2FkLTk2MzQtNGFjNTliZGExMjA5IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkcGtleWNsb2FrdXNlciJ9.dkMXQTE2st-9ilSzYtHz0EJmxjpiDL2WPBliyTdtomKMGtAF5zJbWby-8T5AxydrKpAVnw05suLA9D0CuDfa1IddxsSUV_z5LSETInY-bzTShTChm1TyKZIRbAwbb3kF-sw-ZTmbN_sKXSaw8OngruFYV7zY-0orz3FL9CIJ5Yg
header=Accept-Encoding=gzip,deflate
header=Transfer-Encoding=chunked
header=Content-Type=application/json
header=User-Agent=Apache-HttpClient/4.5.13 (Java/11.0.7)
header=Host=iwf111111.domain.net:7116
locale=[]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=/15.218.114.185:64556
remoteHost=iwf111111.domain.net
scheme=https
host=iwf111111.domain.net:7116
serverPort=7116
isSecure=true
--------------------------RESPONSE--------------------------
contentLength=118
contentType=text/html;charset=UTF-8
header=Server=-
header=X-XSS-Protection=1; mode=block
header=X-Frame-Options=SAMEORIGIN
header=Referrer-Policy=no-referrer
header=Content-Security-Policy=frame-src 'self'; frame-ancestors 'self'; object-src 'none';
header=Date=Tue, 07 Jun 2022 09:23:35 GMT
header=Connection=keep-alive
header=X-Robots-Tag=none
header=Strict-Transport-Security=max-age=31536000; includeSubDomains
header=X-Content-Type-Options=nosniff
header=Content-Type=text/html;charset=UTF-8
header=Content-Length=118
status=400
Version
15.1.1
Expected behavior
The expected behavior would have been that the LDAP Federation configuration was applied.
Actual behavior
400 Bad Request is being thrown from kcadm script
How to Reproduce?
No response
Anything else?
Please let me if there is any workaround here or anything that needs correction here.
Beta Was this translation helpful? Give feedback.
All reactions