Skip to content

OAuth authentication has no way to intercept the Token request #9092

Closed
@Menighin

Description

@Menighin

Is your feature request related to a problem? Please describe.

I'm trying to implement OAuth authentication with PKCE.
The PKCE part requires that I send a code_verifier with the token request but this doesn't seem to be possible. I couldn't find anyway of intercepting the Token Request in order to put the code_verifier. As far as I understood, AspNetCore automatically get the authorization code and request for a token with it, all under the hood.

Describe the solution you'd like

To have an event like OnAuthorizationCodeReceived like we do on the OpenId middleware. Or maybe an even more specific, something like OnRequestForToken.

Describe alternatives you've considered

Implement all from scratch or use a 3rd party lib (any recomendations?)

Additional context

I'm trying to implement following this tutorial that uses OpenId. I couldn't find anything like the OnAuthorizationCodeReceived event on the OAuth so I'm stuck in a scenario where I request for authorization with code_challenge but I can't get the token because I can´t find a way to put the code_ verifier in the request.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-authIncludes: Authn, Authz, OAuth, OIDC, Bearer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions