External IDP in browser flow

Hi there,

I am trying to implement a OAuth2 AuthZ Code flow, browser based, with external IDP. The idea would to keep the actual IDP implementation agnostic, so there will be just a “redirect” to a login URL that will return OK or NOK together with user info. There cannot be any assumption about the IDP being able to do OIDC or SAML.
I am a bit unclear how this should be implemented… Implementing IdentityProvider.authenticate() seems clear, but not so much on how to capture the response.