Thanks.
Can you share the type of the options variable. It is not stated in the document.
Any suggestions?
By the way, the I have checked your answer. On localhost, the app runs as you described. Theme cookies are set on "localhost" domain and ports are ignored. So same cookie for both sites are shared.
On production, I have two seperate subdomain. admin.mysite.com and auth.mysite.com The theme cookies are set for each domain individualy and the values differ between cookies so the experience is broken.
Hello, I will check your reply.
Actually I am not interested about the blazor admin UI. I have a custom UI admin app implemented with VUE. I can not figure out how to open auth-server app so that it renders specific theme. Maybe I can pass a querystring param to the auth-server redirect url.
thanks.. it helps..
well, I have checked the code. the value of the context.returnurl is url encoded so related regex expressions never works as expected. there is an issue there.
furthermore if regex gets fixed, it will not work either, at least for my case. because, returnurl contains the original return_uri(double-encoded) and when we alter the return_uri by replacing culture params, there is an inner security check that expects return_uri not to be altered which throws error indicating that uri is altered. this check is part of authorization code flow, and makes sense. otherwise some one in the middle could alter the returl_url and take control.
so, i guess i need to alter return_uri just before the redirection so that return_uri security checks passes.
public virtual Task ReplaceAsync(QueryStringCultureReplacementContext context) { if (!string.IsNullOrWhiteSpace(context.ReturnUrl)) { if (context.ReturnUrl.Contains("culture=", StringComparison.OrdinalIgnoreCase) && context.ReturnUrl.Contains("ui-Culture=", StringComparison.OrdinalIgnoreCase)) { context.ReturnUrl = Regex.Replace( context.ReturnUrl, "culture=[A-Za-z-]+", $"culture={context.RequestCulture.Culture}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
context.ReturnUrl = Regex.Replace(
context.ReturnUrl,
"ui-culture=[A-Za-z-]+",
$"ui-culture={context.RequestCulture.UICulture}",
RegexOptions.Compiled | RegexOptions.IgnoreCase);
}
}
return Task.CompletedTask;
}
Hi,
Thanks. This resolves half of my problem. Now I can control the language of Auth-Server.
The second part of my question still needs to be answered?
When I change the UI language on Auth-Server, how can I transfer this info back to the original calling UI. The login process completes by redirecting back to redirect_url parameter passed to auth-server from calling ui app. I need to manipulate this redirect_url before actualy redirecting it.
Here is an example;