-
Notifications
You must be signed in to change notification settings - Fork 4k
Client credentials not correctly decoded in Basic Auth #1826
Comments
@OrangeDog It's not clear to me if you are reporting a bug? If this is the case, can you please be more specific so I can better understand where the issue is? |
Yes, it’s a bug. If your client id or secret has a special character in it, you cannot use it with Basic auth, because the code doesn’t decode it properly. |
@OrangeDog I'm going to close this issue based on this comment. |
RFC 6749 is not superseded by RFC 7617. Indeed the whole point of this encoding is so it becomes a valid Basic Authentication header, |
@OrangeDog I missed this on the first read:
I'm surprised this issue hasn't come up already? I guess most client credentials don't have special characters (colon) in it. This is interesting and kind of feels like an edge case. I'd like to test some well-known providers to see if they have implemented this decoding. I'll reopen this and investigate shortly. |
It came up because I was using b64(random()) to generate secrets, and a client was encoding the I would not be surprised if half of all clients and servers have failed to implement this. I'm not necessarily expecting a fix here, but at least have the issue noted, and hopefully fixed in the core spring-security client. Although that's a tricky issue - a non-compliant client can be worked-around, but if the server is non-compliant there's nothing you can do with a compliant client. Probably it needs to be on by default, but able to be disabled on a per-server basis. |
From RFC 6749:
However, the corresponding decoding is not applied when Basic client credentials are received.
Note that people often don't realise this slightly odd encoding is required, and blame their (conformant) client library instead.
The text was updated successfully, but these errors were encountered: