homura_left_得得B - hello i am try to use the ref...
# troubleshooting
n
If you enable verbose mode in LLDAP, what logs do you get when trying to send the refresh query?
h
how do i enable verbose mode ?
n
Also note that the refresh token is not an
Authorization
header, but a
refresh-token
header. The
Authorization
header is for the actual JWT
verbose=true in the config, or LLDAP_VERBOSE=true in the env, or --verbose in the CLI
h
i have also try this according to oauth spec data = { 'grant_type' : 'refresh_token', 'refresh_token' : refesh_token, "client_id": login_username, "client_secret": login_password } r = session.get("http://localhost:17170/auth/refresh", data=data,cookies={"cookie":"123"})
n
The cookie is not needed (you can actually pass the refresh token as a
refresh_token
cookie if you want)
It's not OAuth, so it won't help 🙂 Also, GET queries shouldn't have data
h
but post get 405.., thats why i use get
n
Right, but that just means the query doesn't accept data
h
i still figure out how to set to verbose mode, my docker command was docker run -p 17170:17170 -p 3890:3890 -v /home/user/Jeff/Software/dev_project/lldap/lldap_data:/data nitnelave/lldap
n
You can check how to set environment variables for
docker run
here: https://docs.docker.com/engine/reference/commandline/run/
h
cat lldap_config.toml
Copy code
## Default configuration for Docker.
## All the values can be overridden through environment variables, prefixed
## with "LLDAP_". For instance, "ldap_port" can be overridden with the
## "LLDAP_LDAP_PORT" variable.

## Tune the logging to be more verbose by setting this to be true.
## You can set it with the LLDAP_VERBOSE environment variable."
verbose=true
i already have it enabled but it seems have nothing return in the log
n
When quoting code/logs, make sure to wrap it in triple back-quotes: "``"
My guess is that your docker run command doesn't put the config file in a place that LLDAP can find it. I would either recommend to use docker compose (there's an example in the readme) or if you still want to use docker run, use environment variables to set the verbose mode
h
HTTP request [ 12.9µs | 100.00% ] method: "POST" | uri: "/auth/refresh" 2023-10-13T09:58:14.560054474+00:00 DEBUG ┕━ 🐛 [debug]: | status_code: 405
``
Copy code
data = {
            'grant_type'    : 'refresh_token',            
            'refresh_token' : refesh_token,         
            }
    
        r = session.post("http://localhost:17170/auth/refresh", data=data,cookies={"cookie":"123"})
i have try refresh-token is not accepted,
n
As we talked about earlier, it should be a get, and without data
h
ok where should i pass the refresh token?
n
As I said earlier, either in a "refresh-token" header, or in a "refresh_token" cookie
h
thanks you!