Skip to content

Don't set id_token if not in refresh response #628

@wryrye

Description

@wryrye

Checklist

Description

Per OpenID Connect Core 1.0 specifications, a successful refresh response "might not contain an id_token". This is the case for my setup.

Therefore, when I call AccessToken.refresh(), the id_token is set to undefined, which corrupts the session and forces me to re-authenticate. I'm almost certain this is the same issue encountered in #279.

Can we avoid setting id_token to undefined if the value is not present in the refresh response?

Reproduction

  1. Make a refresh request (req.oidc.accessToken.refresh()) where the response is missing an id_token
  2. Confirm subsequent accesses of req.oidc.idToken and req.oidc.user yield undefined

Additional context

Similar fix in another repo: authts/oidc-client-ts#688

express-openid-connect version

^2.16.0

Express version

^4.18.2

Node.js version

20.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions