-
We are currently implementing the user interface of the identity provider for ory hydra. One of our requirements is that the user interface can be localized to the language which the client is currently using. So for example if the client application is displayed in Japanese language the Login and Consent page should also be displayed in Japanese. At the moment we are somehow stuck how we can get the localization information from the client to the identity provider, since we have to go over hydra's public endpoint and cannot specify the query of the login or consent path directly. In the reference API of GetLoginRequest und GetConsentRequest we saw that there is a field ui_locales in the oidc_context and were wondering if we can use this field for our purpose. Unfortunately I couldn't find any information on how and where this field is set and used for. As a last resort we thought of getting the localization information from the request_urls state parameter in which the information could be encoded. However we are not sure if this really is a good solution? Does anyone have dealt with localization of the identity provider's UI before and can give us a hint in the right direction? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I have not dealt with this problem, but maybe I can give you some pointers. From the API reference
It is set in the OIDC context:
Let me know if that helps, and if we can add something to the documentation to make this clearer. |
Beta Was this translation helpful? Give feedback.
-
I struggled to get this working, primarily because I did not understand the answer, but now I do and I want to write this down for any future person: In my case I stored this value in the Spring session store and then wrote a LocaleContextResolver that accessed the session store. |
Beta Was this translation helpful? Give feedback.
I have not dealt with this problem, but maybe I can give you some pointers.
From the API reference
It is set in the OIDC context: