Closed danj3 closed 3 months ago
I'm a bit swamped at the moment.
@paulswartz Do you have some time to have a look by any chance?
I took a look, and it looks like Oidcc should be doing the right thing and bailing out of private_key_jwt
if there are no keys present: https://github.com/erlef/oidcc/blob/main/src%2Foidcc_auth_util.erl#L183
@danj3 can you share any more about your configuration?
I will put some debugging into the function you called out and report back.
I believe I may be experiencing the same issue. I'm seeing my /par
requests failing with HTTP 400. Downgrading to 3.1.2 appears to resolve the issue. I will post more specifics when I have time to debug.
For reference the OIDC server I'm using is Okta.
Oddly the error message from Okta is The request contained multiple parameters with the same name.
. Which leads me to https://github.com/erlef/oidcc/pull/314, which was merged in 3.2.0.
I think I was mistaken commenting on this thread. The error from Okta appears to be resolved by these changes - https://github.com/erlef/oidcc/pull/360
@danj3 Did you figure anything out?
Closing because of inactivity
oidcc version
3.2.0
Erlang version
26
Elixir version
1.16
Summary
Upon upgrade from 3.1.2 to 3.2 authorization url generation broke at attempt_par (resulting in HTTP 401/Authorization failed). The default available auth methods in oidcc_auth_util.erl:add_client_authentication, when not overridden by Opts will be used, however the client is only configured with a client_secret (for use with Basic or post methods), but the result was (one of) the JWT methods.
It seems some additional client configuration is needed to use the JWT methods (only based on the 401), so does the select_preferred_auth function need to consult the client configuration to determine if a method can be used. Alternatively, is it presumed that the client must always pass preferred_auth_methods if the IDP supports all of them but the client is only configured for a subset?
This problem may be a result of some knowledge deficit of the reporter and if so offers both apologies and request for steps to remedy.
Current behavior
Client configured with client_id and client_secret for create_redirect_url will fail authorization during PAR if the IDP supports JWT methods.
How to reproduce
configure client with client_id and client_secret without a JWT for auth.
Expected behavior
If only client_secret is in the client context/config, without a client_jwks, to detect and remove jwt auth methods during selection.