Thanks for launching those issues. A resolution for either of them would be invaluable to me.
I’ve had a crack at using your short term script solution, and it almost works. I’m coming unstuck on the last command because I’m running in a docker container and the callback goes to 127.0.0.1:443 instead of the address I’ve specified in
~ $ curl -L -b cookie.jar -c cookie.jar "$base_url/oauth/authorize?client_id=cli&redirect_uri=local-callback&response_type=code"
ERROR Could not exchange OAuth access token error=Post "https://localhost/oauth/token": dial tcp 127.0.0.1:443: connect: connection refused
The CLI could not exchange the OAuth access token: Post "https://localhost/oauth/token": dial tcp 127.0.0.1:443: connect: connection refused.
It looks like ttn-lw-cli is ignoring the value of
is.oauth.ui.canonical-url are set to the machine’s static IP address (
I’ve tried the second option in the configuration instructions (
http://localhost:1885) but I get the same result.
In both cases I’ve been using
http rather than
https - could that be an issue? When I try using
curl command fails:
curl -b cookie.jar -c cookie.jar -D headers.txt "$base_url/oauth/"
curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
I’m intending to run this on a private air-gapped server, so https shouldn’t be necessary.
EDIT: I’ve also used the same
base_url value when registering the console and cli for oauth
EDIT 2: the TLS error was due to incorrectly configured TLS (forgot to uncomment the TLS lines in the docker and ttn config files)