bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

Option to return Id token on token refresh #982

Closed adisazhar123 closed 3 years ago

adisazhar123 commented 4 years ago

Answering issue #976

I propose creating a new Refresh Token grant type under OpenID which'll allow returning ID token only if, both of these are fulfilled:

  1. the configuration parameter use_openid_connect is set to true in Server object
  2. the configuration parameter issue_id_token_on_token_refresh is set to true in Server object. This will be a new parameter

I'm thinking of adding a id_token column in table oauth_refresh_tokens to hold the ID token tied to that refresh token. This column will be nullable.

The code isn't done and I would like people's opinion on the approach I've taken.

Cheers, Adis