Skip to content

Advice on cross-domain localization #2637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aspnet-hello opened this issue Jan 2, 2018 · 10 comments
Closed

Advice on cross-domain localization #2637

aspnet-hello opened this issue Jan 2, 2018 · 10 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates question

Comments

@aspnet-hello
Copy link

From @Ponant on Sunday, June 11, 2017 11:42:45 PM

Hello,
I have two websites and one is used as an IdentityServer, where user login to enter credentials or register and where he is redirected back to the second website after. Each website lives on a different domain but I can also target them to sub-domains of a main domain if that is a needed.

Localization is implemented successfully on each website with a dropdown button for the cultures. What I would like is, when a user comes to the website 2, chooses a culture (say DE) and decides to login, I want him to be redirected to IdentityServer with culture DE instead of the default.
I welcome any hint on how to achieve this?

Copied from original issue: aspnet/Localization#382

@aspnet-hello aspnet-hello added this to the Discussions milestone Jan 2, 2018
@aspnet-hello
Copy link
Author

From @hishamco on Monday, June 12, 2017 4:42:57 AM

Frankly I didn't work with Identity server, but if there's a way to pass the culture to the identity server, you could simply append the culture to the querystring when you redirect to other website

I'm happy to hear from @damienbod which wrote a lot of great blog posts about the Identity Server and localization

@aspnet-hello
Copy link
Author

From @Ponant on Monday, June 12, 2017 5:02:39 AM

@hishamco , thank you for your answer and hint. Any link to blog posts on identityserver+localzation would be great as a start; a quick google search returns nothing at first attempt.

@aspnet-hello
Copy link
Author

From @Eilon on Monday, June 12, 2017 10:09:54 AM

Using a query string parameter is probably the best approach here. I think that the security middleware has callback events where you can add additional data to the authentication process, which would get transferred to the authentication server.

@Tratcher - do you know the secret sauce to pass additional data to the auth server? It seems that there are OAuth-standard request parameters for things like "ui locale".

@aspnet-hello
Copy link
Author

From @Tratcher on Monday, June 12, 2017 11:34:34 AM

OAuth2 or OpenIdConnect? The process is similar.

For OAuth2 you implement the OnRedirectToAuthorizationEndpoint event and tack your parameters onto the already assembled RedirectUri.
https://github.com/aspnet/Security/blob/rel/1.1.2/src/Microsoft.AspNetCore.Authentication.OAuth/Events/OAuthEvents.cs#L23

For OpenIdConnect it's OnRedirectToIdentityProvider where you add your custom parameters to the ProtocolMessage.
https://github.com/aspnet/Security/blob/rel/1.1.2/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs#L33

@aspnet-hello
Copy link
Author

From @Ponant on Monday, June 12, 2017 11:46:56 AM

Thanks @Eilon and @Tratcher , I thought that modifying the endpoint is not a secure procedure. I recall having read something like this on the IdenttityServer repo but cannot find the thread anymore. Perhaps @leastprivilege could comment on the reliability of the procedures mentioned above.

@aspnet-hello
Copy link
Author

From @Ponant on Tuesday, June 20, 2017 1:47:41 AM

Hi @Tratcher, can you point to some example using the Funcs you refer to? Cheers

@aspnet-hello
Copy link
Author

From @hishamco on Tuesday, June 20, 2017 4:00:58 AM

Have a look to the test project here and there

@aspnet-hello
Copy link
Author

From @Ponant on Tuesday, June 20, 2017 2:05:10 PM

Thanks @hishamco I will look at that, then.

@hishamco
Copy link
Member

@mkArtakMSFT I think we need to close this issue while it's answered

@aspnet-hello
Copy link
Author

We periodically close 'discussion' issues that have not been updated in a long period of time.

We apologize if this causes any inconvenience. We ask that if you are still encountering an issue, please log a new issue with updated information and we will investigate.

@aspnet-hello aspnet-hello removed this from the Discussions milestone Sep 24, 2018
@dotnet dotnet locked and limited conversation to collaborators Sep 24, 2018
@Eilon Eilon added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates repo:Localization labels Nov 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates question
Projects
None yet
Development

No branches or pull requests

3 participants