In app.yaml I have added openId for the scope of the oauth property. Because of this, instead of going with the oauth flow, Spring was triggering the open id connect flow. The solution was to extend the specific class of OidcService instead of DefaultOAuth2UserService