PushedAuthorizationBehavior default in OidcHandler PAR #62166
Labels
area-auth
Includes: Authn, Authz, OAuth, OIDC, Bearer
✔️ Resolution: By Design
Resolved because the behavior in this issue is the intended design.
Status: Resolved
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue for this?
Describe the bug
The following is most likely corner case back-compatibility scenario with
OidcHandler
but I still wanted to bring it to your attention.We started observing Okta challenge breaking with the following error
The client secret supplied for a confidential client is invalid
returned from Okta after upgrading toMicrosoft.AspNetCore.Authentication.OpenIdConnect 9.0.0.0
. We use Okta in a federated scenario. The request to Okta/authorize
endpoint includesclientId
,openId
scope with response type set toid_token
. The above error was only returned by one of the two Okta tenants we tested with. The exception was thrown inOpenIdConnectHandler.GetPushedAuthorizationRequestUri
.After inspecting the following commit bef4dae#diff-4241f2e2b0ba30cfdc11b53849a5574912f65ab3c7bfc710a93c3176f0b3e49a , we realized that the default for
PushedAuthorizationBehavior
inOpenIdConnectOptions
is set toPushedAuthorizationBehavior.UseIfAvailable
. The Okta instance which returned the error hadpushed_authorization_request_endpoint
listed in its discovery document while the other instance did not. Neither hadrequire_pushed_authorization_requests
flag set to enabled.The
UseIfAvailable
default forced the request to go via PAR backchannel. Subsequently, the Okta instance that exposedpushed_authorization_request_endpoint
started requiring client secret when request came via PAR. It probably treats PAR as a dedicated confidential client channel. Our app didn't originally supply a secret as it was configured as public client. The fix was to setPushedAuthorizationBehavior = PushedAuthorizationBehavior.Disable
in our code. In light of this, I was wondering if a betterPushedAuthorizationBehavior
default should bePushedAuthorizationBehavior.Disable
. Alternatively, the intent could be expressed by client settingUsePushedAuthorization
bool as was initially proposed by @josephdecock in this discussion - #51686 - but doesn't appear to be implemented.Expected Behavior
The oidc challenge continues to work after upgrade to Microsoft.AspNetCore.Authentication.OpenIdConnect 9.0.0.0 for all existing scenarios.
Steps To Reproduce
No response
Exceptions (if any)
.NET Version
9.0
Anything else?
#51686
bef4dae#diff-4241f2e2b0ba30cfdc11b53849a5574912f65ab3c7bfc710a93c3176f0b3e49a
The text was updated successfully, but these errors were encountered: