How to perform delta-import in solr with authentication? - shell

I have completed solr full import, now I have to automate delta-import using linux-cron. This is my shell script:
#!/bin/bash
curl http://localhost:8983/solr/collection/dataimport?command=delta-import
The solr in my server is protected with authentication. so how to authenticate and then do delta-import using curl?

Use the standard HTTP syntax for basic authentication:
curl http://user:pass#localhost:8983/solr/..

Related

Specify jwt token when fetch profile via "go tool pprof"

My api is protected via jwt, is it possible to specify a jwt token when fetch profile via go tool pprof ?
Currently, I have to config jwt middleware to bypass the /debug/pprof routes.
I couldn't find a way to pass a token via go tool pprof directly, but due to the fact that you can use curl to fetch the profile, there is a simple workaround:
$ curl -o profile.out https://host/debug/pprof -H 'X-Authorization: $TOKEN'
$ go tool pprof profile.out

Can I use Elasticsearch https without cert and authentication

I successfully setup HTTPS for Elasticsearch server. Now I can use curl like curl -u elastic:111111 --cacerts "Path/to/my/cert" https://localhost:9200. How can I setup to use curl without user authentication and cert?
Sorry for my bad English :(

kcadm created client is always unauthorized

I am trying to automate setting up of a Keycloak server for an application. Part of that is to set up a Keycloak client using the admin CLI:
kcadm.sh create clients -r MyRealm -s clientId=my-client -s enabled=true
That seems to work; I can see the client is present using the admin console. However, if I try to use that client with the Java client (creating a Keycloak object) even a read-only operation fails due to HTTP 401 Unauthorized. What am I doing wrong?
After much experimenting, I discovered the cause of the problem. If you create a client using the UI, the UI sets the client to be public client with direct access grants enabled by default. The admin CLI however does not, and that results in access through the Java client being denied. You must instead explicitly set those when you create the client using the admin CLI:
kcadm.sh create clients -r MyRealm -s clientId=mc-client -s enabled=true -s directAccessGrantsEnabled=true -s publicClient=true

Can Google Appscript fetch information from a LDAP server?

I need to fetch a lot of information from LDAP server based on the data stored in a Google Sheet. Does google appscript have any library/module to do so?
If it was possible to execute shell commands in appscript like:
ldapsearch -H ldap://ldap.org.website.com -x -D cn=root -w secret -LLL -b "o=myhost" cn=root
Then it would have been easier. Do you know of any work-around for this?
You have no access to the shell in Apps Script. App Script does has HTTP and JDBC services. You would need to run one of those services as a bridge to your LDAP server.
HTTP to LDAP:
https://serverfault.com/questions/372112/is-there-a-simple-ldap-to-http-gateway-out-there
JDBC/LDAP driver:
http://www.openldap.org/jdbcldap/

Creating a keytab on Windows for Kerberos authentication on Linux

I need to run curl commands from a Windows server to an API on a Linux box. When I am on my workstation I just run a kinit and give my user name and pwd for the Kerberos realm.
I have automated scripts in which I need to run a kinit before running the Powershell script. I do not want any manual intervention. I am trying to create a keytab file with my Kerberos account but it is not working -
I am receiving the error message "No key table entry found for user#domain.net while getting initial credentials.
I really don't understand much about Kerberos, and whether the process cares that I am on a Windows server tryng to use a keytab file for this purpose.
Can someone help? I have been going a bit nuts with this...
Thanks for any help!
Look into your keytab if the principal there is the one you are going to use. klist -k -t <keytab>
You are obviously doing wrong. You have to obtain a curl binary for Windows which says with curl --version:
curl 7.46.0 ...
Protocols: http https ...
Features: SSPI Kerberos SPNEGO ...
That's it. Enable SPNEGO auth with curl --negotiate -u : <URL> and you are done. No keytab necessary on Windows.

Resources