Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Make client secret optional while parsing basic authentication secret #2374

Merged
merged 2 commits into from
Jun 22, 2018
Merged

Make client secret optional while parsing basic authentication secret #2374

merged 2 commits into from
Jun 22, 2018

Conversation

AliBazzi
Copy link
Contributor

@AliBazzi AliBazzi commented Jun 9, 2018

This PR add feature request in #2267 ticket

It doesn't introduce breaking change.

@brockallen
Copy link
Member

It doesn't introduce breaking change.

Except the tests?

@AliBazzi
Copy link
Contributor Author

AliBazzi commented Jun 9, 2018

Sorry didn't get it, can you elaborate more ?

@brockallen
Copy link
Member

Sorry didn't get it, can you elaborate more ?

Well, look at the status:

Some checks were not successful
1 failing and 1 successful checks
continuous-integration/appveyor/pr — AppVeyor build failed

@AliBazzi
Copy link
Contributor Author

AliBazzi commented Jun 9, 2018

Oh yes, I noticed that, but it looks like it's related to Ubuntu where it failed to compile the integration test project, the windows image with visual studio passed all tests

I don't think the modified unit test broke that project

@brockallen
Copy link
Member

Ah yes, you're right -- I hadn't followed the link to know it was the unbutu build. I guess something environmental.

@AliBazzi
Copy link
Contributor Author

AliBazzi commented Jun 9, 2018

This is my second PR to Identity server, and both of them were very minimal changes, but my bad luck jumped in the verification process in both PR, the earlier one failed mysteriously as well

@brockallen
Copy link
Member

No worries. We'll have a look. Thanks

@AliBazzi
Copy link
Contributor Author

AliBazzi commented Jun 9, 2018

Welcome :)

@leastprivilege
Copy link
Member

Thanks!

Could you also add an integration test - basically a client with empty secret calling into the token endpoint - I want to make sure, nothing breaks later in the pipeline because of a null secret.

@AliBazzi
Copy link
Contributor Author

Sure, working on it :)

@AliBazzi
Copy link
Contributor Author

@leastprivilege please take a look at the integration test when you have time.

@leastprivilege
Copy link
Member

You also need a test for an empty secret I guess - not just RequireClientSecret = false.

@AliBazzi
Copy link
Contributor Author

So to verify the assertion of the test with you:
define a client with a secret as empty string, and this client configuration have RequireClientSecret set to false
The test will verify that it pass with the expected payload by passing the client Id and the empty client secret as basic authentication style.

Correct me if I'm wrong, and thanks for the help in advance.

@leastprivilege
Copy link
Member

Add a client with require secret = true but an empty secret - see if that works as expected.

@AliBazzi
Copy link
Contributor Author

Hi @leastprivilege

After investigating the code, I think the semantic of empty secret is not supported currently, what is supported is a client that has RequireClientSecret set to false.
When that property is set to false it was breaking client id and empty secrets passed in the Basic Authorization header, this PR aimed to fix this bug in BasicAuthenticationSecretParser, so adding a test to verify that a client secret empty + RequireClientSecret set to True will not pass due to current implementation.

Please advice on the next step and correct me please if I'm wrong.

@leastprivilege
Copy link
Member

You are probably right - will have a look and merge later...thanks!

@leastprivilege leastprivilege self-assigned this Jun 18, 2018
@leastprivilege
Copy link
Member

thanks!

@leastprivilege leastprivilege merged commit e021867 into IdentityServer:dev Jun 22, 2018
@leastprivilege leastprivilege added this to the 2.3 milestone Jun 22, 2018
@AliBazzi AliBazzi deleted the CaterEmptyClientSecret branch June 22, 2018 14:41
@lock
Copy link

lock bot commented Jan 10, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants