My temporary "solution": I unsinstalled the Delphi package, rewrote the code in sgcHTTP_OAuth2_Client.pas for the method TsgcHTTPComponentClient_OAuth2.GetAuthorizationURL;
// commented out those lines
//vParams := vParams + '&' + CS_OAUTH2_SCOPE + '=' +
// AuthorizationServerOptions.GetScope;
vParams := vParams + '&' + CS_OAUTH2_STATE + '=' + OAuth2Options.State;
oURI := TIdURI.Create('');
Try
result := AuthorizationServerOptions.AuthURL + '?' +
oURI.ParamsEncode(vParams);
Finally
sgcFree(oURI);
End;
// new lines, scopeParams is a simple string
scopeParams := AuthorizationServerOptions.GetScope;
if scopeParams<>'' then
begin
Result := Result + '&' + CS_OAUTH2_SCOPE + '=' + scopeParams;
end;
and recompiled and installed the components again. That works. But is it the way it's supposed to be?
Sidenote: I compiled the shipped demo as well with my version of esegece components and it doesn't work either. So I must have missed an update, but our subscription period has just ended a few weeks ago.