Open luckylinux opened 8 months ago
OK I resolved the missing TokenEndpoint
by putting:
"TokenEndpoint": "https://auth.MYDOMAIN.TLD/application/o/netbird/oauth/v2/token"
In management.json
(based on the findings from https://github.com/netbirdio/netbird/issues/750)
But now I get a different error
2024-03-09T19:39:09Z INFO management/cmd/management.go:447: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration Get "https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration": stopped after 10 redirects
2024-03-09T19:41:37Z INFO management/cmd/management.go:447: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-09T19:41:38Z INFO management/cmd/management.go:452: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-09T19:41:38Z INFO management/cmd/management.go:454: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:458: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:463: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:466: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:474: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:484: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value:
2024-03-09T19:41:38Z INFO management/cmd/management.go:487: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value:
2024-03-09T19:41:38Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-09T19:41:38Z INFO management/server/store.go:94: using SQLite store engine
Error: failed retrieving a new idp manager with err: authentik IdP configuration is incomplete, TokenEndpoint is missing
2024-03-09T19:45:00Z INFO management/cmd/management.go:447: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-09T19:45:01Z INFO management/cmd/management.go:452: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-09T19:45:01Z INFO management/cmd/management.go:454: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:458: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:463: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:466: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:474: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:484: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value:
2024-03-09T19:45:01Z INFO management/cmd/management.go:487: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value:
2024-03-09T19:45:01Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-09T19:45:01Z INFO management/server/store.go:94: using SQLite store engine
Error: failed retrieving a new idp manager with err: authentik IdP configuration is incomplete, TokenEndpoint is missing
2024-03-10T08:47:40Z INFO management/cmd/management.go:447: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-10T08:47:41Z INFO management/cmd/management.go:452: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-10T08:47:41Z INFO management/cmd/management.go:454: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value:
2024-03-10T08:47:41Z INFO management/cmd/management.go:458: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value:
2024-03-10T08:47:41Z INFO management/cmd/management.go:463: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/oauth/v2/token
2024-03-10T08:47:41Z INFO management/cmd/management.go:466: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value:
2024-03-10T08:47:41Z INFO management/cmd/management.go:474: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value:
2024-03-10T08:47:41Z INFO management/cmd/management.go:484: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/oauth/v2/token
2024-03-10T08:47:41Z INFO management/cmd/management.go:487: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value:
2024-03-10T08:47:41Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-10T08:47:41Z INFO management/server/store.go:94: using SQLite store engine
2024-03-10T08:47:41Z INFO management/cmd/management.go:159: update config with activity store key
2024-03-10T08:48:12Z INFO management/cmd/management.go:171: geo location service has been initialized from /var/lib/netbird/
2024-03-10T08:48:12Z INFO management/server/account.go:849: single account mode enabled, accounts number 0
2024-03-10T08:48:12Z WARN management/cmd/management.go:185: TrustedPeers are configured to default value '0.0.0.0/0', '::/0'. This allows connection IP spoofing.
2024-03-10T08:48:14Z WARN management/server/account.go:889: failed warming up cache due to error: Post "https://auth.MYDOMAIN.TLD/application/o/netbird/oauth/v2/token": EOF
Error: failed creating JWT validator: Get "https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/": EOF
Any update ? Or any idea what log file I should provide and how ?
@luckylinux, as stated in #1715, you are using Keycloak now. Do you want to continue troubleshooting this issue? If so, it seems like the IDP Manager configuration is incomplete; you can share its values by masking domains and secrets.
It is part of the management.json, with the key IdpManagerConfig
@mlsmaycon Well for now I'm not really using anything as nothing is working, for different reasons:
So, for now, we can keep going with Keycloak (I don't really care, I just would like netbird+something+traefik+homeassistant to be able to access my home assistant instance remotely).
But ultimately it should also work with Authentik IMHO ...
I masked 2 values and replaced them by AUTHENTIK_CLIENT_ID_SECRET
and AUTHENTIK_CLIENT_PASSWORD_SECRET
"IdpManagerConfig": {
"ManagerType": "authentik",
"ClientConfig": {
"Issuer": "",
"TokenEndpoint": "https://auth.MYDOMAIN.TLD/application/o/netbird/oauth/v2/token",
"ClientID": "AUTHENTIK_CLIENT_ID_SECRET",
"ClientSecret": "",
"GrantType": "client_credentials"
},
"ExtraConfig": {
"Password": "AUTHENTIK_CLIENT_PASSWORD_SECRET",
"Username": "netbird"
},
"Auth0ClientCredentials": null,
"AzureClientCredentials": null,
"KeycloakClientCredentials": null,
"ZitadelClientCredentials": null
}
Thanks for sharing it @luckylinux , it seems the Issuer is also missing. These values get filled via the configure.sh script, if you still have your setup.env file, you can run it again and ensure that the TokenEndpoint and Issuer are set, as well as the client ID, Password, and Usernames.
As for the Username, the guide creates a Netbird user with uppercase N. Can you double-check that, too?
As an alternative, to get started, you can disable the IdpManagerConfig by setting the ManagerType to "none." that won't map user IDs to email addresses but should allow you to explore the platform.
Thanks for sharing it @luckylinux , it seems the Issuer is also missing. These values get filled via the configure.sh script, if you still have your setup.env file, you can run it again and ensure that the TokenEndpoint and Issuer are set, as well as the client ID, Password, and Usernames.
As for the Username, the guide creates a Netbird user with uppercase N. Can you double-check that, too?
As an alternative, to get started, you can disable the IdpManagerConfig by setting the ManagerType to "none." that won't map user IDs to email addresses but should allow you to explore the platform.
Netbird lowercase is intentional. My user is netbird
:).
What should I set for issuer ? I do not have such a parameter in setup.env. How should I set it and to what ?
You can run:
apt install jq
curl https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration | jq
That will give you JSON response with the issuer value.
OK ... That would be
issuer: "https://auth.MYDOMAIN.TLD/application/o/netbird/"
(I just grabbed it from Firefox :))
I fixed that in management.json
by setting the issuer
in IdpManagerConfig
but the container netbird-management
continuously crashes.
The logs show
2024-03-19T06:06:19Z INFO management/cmd/management.go:449: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
Error: failed reading provided config file: /etc/netbird/management.json: failed fetching OIDC configuration from endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration Get "https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration": EOF
Very similar / same error as happened before.
Any update ? Google didn't return similar error messages ...
I could validate both using jq empty $file.json
or cat $file.json | jq empty
both for
Removed
I could download locally (from the host serving the containers, i.e. remotely):
curl https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
Restarted all netbird containers.
Now I am getting:
2024-03-26T19:08:34Z INFO management/cmd/management.go:449: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:08:37Z INFO management/cmd/management.go:454: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:08:37Z INFO management/cmd/management.go:456: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/
2024-03-26T19:08:37Z INFO management/cmd/management.go:460: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/
2024-03-26T19:08:37Z INFO management/cmd/management.go:465: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:08:37Z INFO management/cmd/management.go:468: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/device/
2024-03-26T19:08:37Z INFO management/cmd/management.go:476: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value: auth.MYDOMAIN.TLD
2024-03-26T19:08:37Z INFO management/cmd/management.go:486: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:08:37Z INFO management/cmd/management.go:489: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/authorize/
2024-03-26T19:08:37Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-26T19:08:37Z INFO management/server/store.go:92: using SQLite store engine
2024-03-26T19:08:39Z INFO management/cmd/management.go:172: geo location service has been initialized from /var/lib/netbird/
2024-03-26T19:08:39Z INFO management/server/account.go:848: single account mode enabled, accounts number 0
2024-03-26T19:08:39Z WARN management/cmd/management.go:186: TrustedPeers are configured to default value '0.0.0.0/0', '::/0'. This allows connection IP spoofing.
Error: failed creating JWT validator: invalid character 'e' looking for beginning of value
It would be nice if the line number of the error would also be reported ...
Any idea ?
Now actually it's going a bit further, netbird-management
does not crash, but I still cannot see a webpage working...
2024-03-26T19:08:34Z INFO management/cmd/management.go:449: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:08:37Z INFO management/cmd/management.go:454: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:08:37Z INFO management/cmd/management.go:456: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/
2024-03-26T19:08:37Z INFO management/cmd/management.go:460: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/
2024-03-26T19:08:37Z INFO management/cmd/management.go:465: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:08:37Z INFO management/cmd/management.go:468: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/device/
2024-03-26T19:08:37Z INFO management/cmd/management.go:476: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value: auth.MYDOMAIN.TLD
2024-03-26T19:08:37Z INFO management/cmd/management.go:486: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:08:37Z INFO management/cmd/management.go:489: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/authorize/
2024-03-26T19:08:37Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-26T19:08:37Z INFO management/server/store.go:92: using SQLite store engine
2024-03-26T19:08:39Z INFO management/cmd/management.go:172: geo location service has been initialized from /var/lib/netbird/
2024-03-26T19:08:39Z INFO management/server/account.go:848: single account mode enabled, accounts number 0
2024-03-26T19:08:39Z WARN management/cmd/management.go:186: TrustedPeers are configured to default value '0.0.0.0/0', '::/0'. This allows connection IP spoofing.
Error: failed creating JWT validator: invalid character 'e' looking for beginning of value
2024-03-26T19:11:55Z INFO management/cmd/management.go:449: loading OIDC configuration from the provided IDP configuration endpoint https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:11:56Z INFO management/cmd/management.go:454: loaded OIDC configuration from the provided IDP configuration endpoint: https://auth.MYDOMAIN.TLD/application/o/netbird/.well-known/openid-configuration
2024-03-26T19:11:56Z INFO management/cmd/management.go:456: overriding HttpConfig.AuthIssuer with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/
2024-03-26T19:11:56Z INFO management/cmd/management.go:460: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/netbird/jwks/
2024-03-26T19:11:56Z INFO management/cmd/management.go:465: overriding DeviceAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:11:56Z INFO management/cmd/management.go:468: overriding DeviceAuthorizationFlow.DeviceAuthEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/device/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/device/
2024-03-26T19:11:56Z INFO management/cmd/management.go:476: overriding DeviceAuthorizationFlow.ProviderConfig.Domain with a new value: auth.MYDOMAIN.TLD, previously configured value: auth.MYDOMAIN.TLD
2024-03-26T19:11:56Z INFO management/cmd/management.go:486: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/token/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/token/
2024-03-26T19:11:56Z INFO management/cmd/management.go:489: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://auth.MYDOMAIN.TLD/application/o/authorize/, previously configured value: https://auth.MYDOMAIN.TLD/application/o/authorize/
2024-03-26T19:11:56Z INFO management/server/telemetry/app_metrics.go:177: enabled application metrics and exposing on http://0.0.0.0:8081
2024-03-26T19:11:56Z INFO management/server/store.go:92: using SQLite store engine
2024-03-26T19:11:57Z INFO management/cmd/management.go:172: geo location service has been initialized from /var/lib/netbird/
2024-03-26T19:11:57Z INFO management/server/account.go:848: single account mode enabled, accounts number 0
2024-03-26T19:11:57Z WARN management/cmd/management.go:186: TrustedPeers are configured to default value '0.0.0.0/0', '::/0'. This allows connection IP spoofing.
2024-03-26T19:11:58Z WARN management/server/account.go:888: failed warming up cache due to error: unable to get authentik token, statusCode 405
2024-03-26T19:11:59Z INFO management/cmd/management.go:287: running gRPC backward compatibility server: [::]:33073
2024-03-26T19:11:59Z INFO management/cmd/management.go:319: management server version 0.26.3
2024-03-26T19:11:59Z INFO management/cmd/management.go:320: running HTTP server and gRPC server on the same port: [::]:80
@mlsmaycon: any News on this ? I just tried again with an Updated v0.29.3 Install now, but same Error.
Where is this originating from ?
[netbird-management] | Error: failed creating JWT validator: invalid character 'e' looking for beginning of value
That seems to be the only Error that I can see at least ... Possibly there is some other Stuff going on with Traefik Reverse Proxy and Cloudflare DNS Proxy ???
Describe the problem
I am facing lots of different issues during the setup of Netbird and Authentik (self hosted).
Following the tutorial is quite straightforward and most of the things seem to work.
I am stuck in the part that relates to the "netbird-management" container.
I use Cloudflare Proxy DNS and I had "Your SSL/TLS encryption mode" set to "Off". Now I turned it to "Full (Strict)" based on some guidelines on Cloudflare.
I also added 127.0.0.1 auth.MYDOMAIN.TLD to /etc/hosts (on the Podman Host) but that did not really solve the issues.
There are just too many redirects / connection refused / sometimes invalid X509 certificate (the latter probably when using the /etc/hosts entry line) going on here.
To Reproduce
Steps to reproduce the behavior:
compose.yml
filevolumes:
netbird-mgmt:
netbird-signal:
netbird-letsencrypt:
networks: traefik: external: true
host: arch: amd64 buildahVersion: 1.33.5 cgroupControllers: