i've datahub connected to oidc, currently trying t...
# troubleshoot
b
i've datahub connected to oidc, currently trying to troubleshoot an issue where the users reported encountering error 502 when they attempted to reach datahub. (continued in thread)
traced to an issue of the returned oidc token being too big, causing an exception in frontend-react [CompletionException: org.pax4j.core.exception.TechnicalException: Bad token response, error=invalid grant]
i didnt set any optional OIDC configs in frontend-react
is there any settings that we can adjust for the size of the token?
b
Hey!
Invalid grant - how do you know that size of token isa problem?
b
My colleague noticed that people with too many roles in the oidc token are unable to login, we inferred that the token has too much information inside. Initially we thought it was a networking problem. Once we removed some roles, there is no issue accessing
b
oh man
Thanks for the details. Can we try to change the OIDC request mode? Do you know if you're using GETs or POSTs?
b
I'll try to replicate the issue we faced in intranet with a keycloak setup. I just used the default oidc settings in docker.env
b
Okay got it -- you can try the POST mode config and see if that makes any difference, will send an example
You can try to adjust the client request method using the following environment variable in datahub-frontend:
Copy code
- `AUTH_OIDC_CLIENT_AUTHENTICATION_METHOD`: a string representing the token authentication method to use with the identity provider. Default value
is `client_secret_basic`, which uses HTTP Basic authentication. Another option is `client_secret_post`, which includes the client_id and secret_id 
as form parameters in the HTTP POST request. For more info, see [OAuth 2.0 Client Authentication](<https://darutk.medium.com/oauth-2-0-client-authentication-4b5f929305d4>)
So you'd say
Copy code
AUTH_OIDC_CLIENT_AUTHENTICATION_METHOD: client_secret_post
b
Thanks for the tip! Will give it a go soon
b
Thanks - let me know how goes!!
b
Sorry, haven't been able to test because of illness, will update when I'm able to
b
Sorry to hear that - no rush on our side
b
hi @big-carpet-38439, i'm still encountering the same error msg
am trying to reduce the size of the token by reducing the amount of information sent back from keycloak, will update again
b
Okay. An update on my side: For an unrelated reason i'm investigating Pac4J, the library we use for OIDC authentication to a newer version. I'll have to comb through release notes, but I'm hopeful that maybe this issue has been addressed in that library
b
i would love to dig deeper to confirm the cause but distracted by other work at the moment... will update when i can on this.
ok, it seems to be an issue caused by k8s for my org... seems like i can get around by setting
<http://nginx.ingress.kubernetes.io/proxy-buffer-size|nginx.ingress.kubernetes.io/proxy-buffer-size>
inside my ingress because when i deployed datahub without k8s, it didnt have the issue.