IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

demo.identityserver.io support for authorization code flow without PKCE

Open texnokot opened this issue 5 years ago • 13 comments

Question

demo.identityserver.io is not supporting authorization code flow without PKCE anymore. Or at least there is no client id provided for it. Can you please add support for it as well?

The need is for demo-ing Identity Server as OpenId provider for other IdP. The problem is that now I can't add demo.identityserver.io in my IdP as an alternative IdP as it was before.

Thank you!

texnokot avatar Mar 08 '21 15:03 texnokot

Perhaps they are aligning it to OAuth 2.1 spec where PKCE is required for all OAuth clients using the authorization code flow (https://oauth.net/2.1/)

jafin avatar Mar 09 '21 06:03 jafin

Code flow without PKCE is vulnerable to code injection attacks. That's why we do not expose it.

leastprivilege avatar Mar 09 '21 06:03 leastprivilege

I know about vulnerabilities related to authz code flow. What I'm trying to do is to use demo environment for connecting it to B2C. Like this example: https://medium.com/the-new-control-plane/connecting-azure-ad-b2c-to-identityserver4-via-the-b2c-custom-identity-provider-fd5ec0fbba0f B2C is supporting PKCE but for their apps. So in this case which client should I use, if I want to utilize demo for federating with another IdP?

texnokot avatar Mar 09 '21 07:03 texnokot

client id: interactive.confidential grant type: authorization code with PKCE and client credentials client secret: secret access token lifetime: 60 minutues allowed scopes: openid profile email api offline_access

leastprivilege avatar Mar 09 '21 09:03 leastprivilege

Thanks! Yes, I tried this one before writing this question. In this configuration with B2C I get: Sorry, there was an error : invalid_request code challenge required

It seems it still goes thru PKCE path and that's not the way to work for IS4<->B2C

texnokot avatar Mar 09 '21 12:03 texnokot

That means that B2C is not sending the code challenge - IOW - no PKCE. I cannot believe that B2C doesn't support PKCE.

leastprivilege avatar Mar 09 '21 17:03 leastprivilege

B2C is supporting PKCE for clients registered in it, but not then you federate it with another IdP. So before the changes on demo environment, this scenario worked: https://medium.com/the-new-control-plane/connecting-azure-ad-b2c-to-identityserver4-via-the-b2c-custom-identity-provider-fd5ec0fbba0f

Now with "client id: interactive.confidential" is not working by failing with provided message above.

texnokot avatar Mar 10 '21 07:03 texnokot

Then B2C is not secure...

leastprivilege avatar Mar 10 '21 07:03 leastprivilege

Does B2C support hybrid flow instead?

leastprivilege avatar Mar 10 '21 07:03 leastprivilege

yes, it does support Hybrid flow

texnokot avatar Mar 10 '21 08:03 texnokot

https://github.com/IdentityServer/IdentityServer4.Demo/actions/runs/638872074

I believe you know how to get all the info you need from this link ;)

leastprivilege avatar Mar 10 '21 10:03 leastprivilege

Thanks, Dominick! Works like a charm. Will close this thread.

Thanks again for the support. And have a good one! :)

texnokot avatar Mar 10 '21 11:03 texnokot

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

github-actions[bot] avatar Mar 24 '21 11:03 github-actions[bot]