Hi Jerome,
Thanks for your explanations
You are totally right, our view of the role and usage of the OIDC ID Token and Access Token were very wrong
The comments on this post on stack overflow are also very informative on the role of each token:
https://stackoverflow.com/questions/34371782/oauth-2-0-authorization-server-and-access-tokensThe ID Token is "linked" to the Web session and the user must relogin when the ID Token or the Web session expires.
And in our case, the Access token returned from the OIDC login flow is just used to access remote REST resources. We'll check it's validity before performing REST call (and perform the OIDC/Oauth2 "refresh" flow if necessary). The AT will be added as an Authorization Bearer header in the REST calls. On the REST server side, it will be checked/decoded/validated for validity and to perform authorize/reject the call based on the roles held in the token
Thanks a lot for your help and a big big thanks for what you've done with pac4j!
Denis