Browser flow with conditional login form

I’m going to change the client adapters of my custom apps from CAS protocol to OIDC protocol.
CAS protocol has an interesting feature that can check if a user is logged or not without blocking the service call.
This feature is activated redirecting the user to IDP with a parameter gateway=true: if the user is already logged than return with the token, if the user is not logged then no token is returned to the service.
If I want to preserve the same behaviour with the OIDC protocol I have to configure the browser flow with a custom Authenticator? Maybe something that check the gateway request parameter and redirect back to the service before showing the login form?