Can we have a way to send a post-logout redirect URI along with the logout and end session request? I'm thinking about something like the following in TSphinxWebLogin:
procedure LogoutAndEndSession(const APostLogoutRedirectUri: string); overload;- or
procedure LogoutAndEndSessionTo(const APostLogoutRedirectUri: string);
Unless I'm mistaken, currently SphinxLogin.LogoutAndEndSession does not send a post_logout_redirect_uri parameter and leaves the user at the "signed out" page. In our case, once signed out, we would like the browser to be redirected to the login page.
I've implemented the following workaround in our project that performs the desired behaviour. You can send a post-logout redirect with Client.BuildLogoutUrl, however client is strict protected and so cannot called from consuming code (hence the need for the wrapper).
TSphinxWebLoginCracker = class(TSphinxWebLogin)
public
[Async]
procedure LogoutAndEndSessionTo(const APostLogoutRedirectUri: string);
end;
procedure TSphinxWebLoginCracker.LogoutAndEndSessionTo(const APostLogoutRedirectUri: string);
var
LIdToken: string;
LEndSessionUrl: string;
begin
LIdToken := '';
if Storage.AuthResult <> nil then
LIdToken := Storage.AuthResult.IdToken;
Logout;
LEndSessionUrl := await(Client.BuildLogoutUrl(LIdToken, APostLogoutRedirectUri));
if LEndSessionUrl <> '' then
window.location.href := LEndSessionUrl;
end;
Also note that the post-logout redirect URI has been added to SphinxClientApp.PostLogoutRedirectUris for validation. Is there a better way of implementing this behaviour, please?