Yes,
I follow these articles (especially Customizing the Id_Token in OpenID Connect Scenarios) but I cannot make it work with server application or website.
I change my code to implicit flow and configured a native app. In this case, the rule claims in the associated web api are called and the id_token is correctly populated. But then, I cannot obtain a user impersonated access token for another api as it would
required a UserAssertion built from an access token the implicit flow doesn't permit to gain at the first place.
To go further, in the native app case, if the native app is not authorized in client permissions, then ADFS returns an error "The+client+is+not+allowed+to+access+the+requested+resource". Meaning that the process
to populate id_token found the web api and check permission before evaluating claim rules.
This is not the case with server application and the id_token is returned without even trying to found a resource of same Id to populate the id_token. Wether the response type is "code" (code grant flow) or "code+id_token" (hybrid
flow).