Open nicedevil007 opened 7 months ago
Hi! It looks like openid-client
can't discover the issuer by the provided URL:
const issuer = await openidClient.Issuer.discover(sails.config.custom.oidcIssuer);
Please try to navigate to the address of your issuer https://auth.mydomain.org/api/v1/oauth
in a browser and see where you will be redirected to and specify the final address. It's also possible that you need to put a slash at the end of https://auth.mydomain.org/api/v1/oauth/
(but it's just a guess why redirection is done).
Ok I tested this with /
and without.
Not working at all.
This is what I have available as URL on my FortiAuthenticator.
{
"issuer": "https://auth.mydomain.org/api/v1/oauth",
"authorization_endpoint": "https://auth.mydomain.org/api/v1/oauth/authorize/",
"token_endpoint": "https://auth.mydomain.org/api/v1/oauth/token/",
"userinfo_endpoint": "https://auth.mydomain.org/api/v1/oauth/userinfo/",
"jwks_uri": "https://auth.mydomain.org/api/v1/oauth/.well-known/keys/",
"response_types_supported": [
"code",
"token",
"id_token",
"id_token token",
"code token",
"code id_token",
"code id_token token"
],
"subject_types_supported": [
"public"
],
"id_token_signing_alg_values_supported": [
"RS256"
],
"token_endpoint_auth_methods_supported": [
"client_secret_post",
"client_secret_basic"
]
}
So what should I take from these ones?
The response looks correct. It's very hard to say why this might be happening. We'll try to test with FortiAuthenticator sometime or maybe someone has already encountered this and can tell us how to solve it.
Ok got a bit further but without succesfull login. I just changed the OIDC_ISSUER URL to this here:
OIDC_ISSUER=https://auth.mydomain.org/api/v1/oauth/.well-known/openid-configuration
Now our fortiauthenticator tells me (after succesfull login to the FAC)
Is it even possible to not use the auto config method but use the method where we have to add all URI's by ourselfes?
Got a bit further, now Planka tells me that an unknown error appeared, where can I find those logs to get a bit more information about the error?
Found this in the docker logs:
2024-06-24 19:03:45 [W] Error while exchanging OIDC code: RPError: iss mismatch, expected https://auth.*******.org/api/v1/oauth, got: https://auth.*******.org/api/v1/oauth/.well-known/openid-configuration/
2024-06-24 19:03:45 [W] Invalid code or nonce! (IP: *******)
2024-06-24 19:04:08 [W] Error while exchanging OIDC code: RPError: iss mismatch, expected https://auth.*******.org/api/v1/oauth, got: https://auth.*******.org/api/v1/oauth/.well-known/openid-configuration/
2024-06-24 19:04:08 [W] Invalid code or nonce! (IP: *******)
Found this in the docker logs:
2024-06-24 19:03:45 [W] Error while exchanging OIDC code: RPError: iss mismatch, expected https://auth.*******.org/api/v1/oauth, got: https://auth.*******.org/api/v1/oauth/.well-known/openid-configuration/ 2024-06-24 19:03:45 [W] Invalid code or nonce! (IP: *******) 2024-06-24 19:04:08 [W] Error while exchanging OIDC code: RPError: iss mismatch, expected https://auth.*******.org/api/v1/oauth, got: https://auth.*******.org/api/v1/oauth/.well-known/openid-configuration/ 2024-06-24 19:04:08 [W] Invalid code or nonce! (IP: *******)
If I do what is telling me the error message (removing /.well-known/openid-configuration/
from the expected URI) it leads to this error in the docker logs:
2024-06-24 20:10:30 [E] A hook (`oidc`) failed to load!
2024-06-24 20:10:30 [E] Failed to lift app: expected 200 OK, got: 301 Moved Permanently
Now I would assume this is an error because planka is behind a reverseproxy?
Is there anything new here?
Hey guys, I'm trying to get OIDC working with our FortiAuthenticator. Unfortunately I can't get anything up and running.
My planka systemd service stops with the following message:
Here is my config:
So here a quick overview of the network that is all this in:
Network A: planka is hosted on seperate Ubuntu VM (it is installed with manual install method) Network B: Nginx Proxy Manager that forwards traffic going to https://planka.email.server to the Network A VM with Planka running on it Network C: FortiAuthenticator
Ofc: All firewall rules to reach the one or other Network are up and running and nothing is blocked so far (at least this is what my logs tell me ;D)
If I disable all OIDC env variables it is working with local logins.