Require 'id_token' only if 'openid' scope both requested and granted


It turns out that some authorization servers may grant openid scope
when none was requested. If the server does not also provide an
id_token, Qt OAuth2 implementation interprets this as an RFC violation.

However, strictly speaking, this is allowed by RFC.

If the client has not *requested* for openid scope, the behaviour is
not governed by the OIDC specification. It is thus allowed for the
authorization server to grant unsolicited 'openid' scope, with or
without 'id_token', and Qt implementation must not raise an error.

Fixes: QTBUG-145561
Pick-to: 6.11
Change-Id: I4c83d00f98a33b54b144402d74901e90eb02db16
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Andreas Beckermann <beckermann@monument-software.de>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
commit4d5f3534cc035e4c1a256c6e3a3a043c0d12c8b0
parentc5abb66d984ad3c319c77c2fddcfe8257325c909
authorJuha Vuolle <juha.vuolle@qt.io>
committerJuha Vuolle <juha.vuolle@qt.io>
commit timeThu, 9 Apr 2026 09:13:08 +0300