Skip to content

Commit 49380df

Browse files
Merge pull request #569 from DonOmalVindula/feat/readonly-federated-profile
feat: render a read-only profile for identity-provider-managed accounts
2 parents 8f4b93a + d6cbd73 commit 49380df

24 files changed

Lines changed: 682 additions & 24 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@asgardeo/javascript': patch
3+
'@asgardeo/i18n': patch
4+
'@asgardeo/react': patch
5+
'@asgardeo/nextjs': patch
6+
---
7+
8+
Render a read-only profile for users whose attributes are owned by an identity provider.
9+
10+
Asgardeo rejects attribute updates for accounts provisioned from a social or enterprise connection, so the profile used to offer edit controls that always failed with a raw SCIM error.
11+
12+
- `<UserProfile />` accepts `editable="auto"` in React and Next.js. On Asgardeo it looks up the signed-in user's federated associations and, when the account is linked to a connection, renders the profile read-only with a short note naming the provider. On WSO2 Identity Server, where the same updates succeed, the profile stays editable.
13+
- `<UserDropdown />` forwards `editable` to the profile it opens from "Manage profile", so the modal follows the same rule as the page.
14+
- `BaseUserProfile` accepts a predicate for `editable`, so applications can decide per user without any lookup, and a `readOnlyNote` to explain why editing is unavailable.
15+
- A rejected update is now reported in plain words instead of the raw SCIM error, and switches the profile to read-only for the rest of the session. The Next.js `<UserProfile />` previously ignored update failures entirely.
16+
- New API `getMeFederatedAssociations` in `@asgardeo/javascript` and `@asgardeo/react`, plus the `signup`-style texts `user.profile.readonly.federated` and `user.profile.update.not.allowed.error` in all i18n bundles.
17+
18+
While `auto` is resolving, the profile shows a loading state rather than edit controls it may have to take away; `BaseUserProfile` now renders that state whenever `isLoading` is set, in both inline and popup modes. In popup mode the lookup is deferred until the profile is actually opened.

‎packages/i18n/src/models/i18n.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ export interface I18nTranslations {
117117

118118
'user.profile.heading': string;
119119
'user.profile.update.generic.error': string;
120+
'user.profile.loading': string;
121+
'user.profile.readonly.federated': string;
122+
'user.profile.update.not.allowed.error': string;
120123

121124
/* |---------------------------------------------------------------| */
122125
/* | Organization Switcher | */

‎packages/i18n/src/translations/en-US.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ const translations: I18nTranslations = {
119119
/* |---------------------------------------------------------------| */
120120

121121
'user.profile.heading': 'Profile',
122+
123+
'user.profile.loading': 'Loading profile',
122124
'user.profile.update.generic.error': 'An error occurred while updating your profile. Please try again.',
125+
'user.profile.readonly.federated': 'This profile is managed by your {provider} account and cannot be edited here.',
126+
'user.profile.update.not.allowed.error':
127+
'Your profile is managed by your identity provider, so these details cannot be changed here.',
123128

124129
/* |---------------------------------------------------------------| */
125130
/* | Organization Switcher | */

‎packages/i18n/src/translations/fr-FR.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ const translations: I18nTranslations = {
118118
/* |---------------------------------------------------------------| */
119119

120120
'user.profile.heading': 'Profil',
121+
122+
'user.profile.loading': 'Chargement du profil',
123+
124+
'user.profile.readonly.federated': 'Ce profil est géré par votre compte {provider} et ne peut pas être modifié ici.',
125+
126+
'user.profile.update.not.allowed.error':
127+
"Votre profil est géré par votre fournisseur d'identité, ces informations ne peuvent donc pas être modifiées ici.",
121128
'user.profile.update.generic.error':
122129
'Une erreur est survenue lors de la mise à jour de votre profil. Veuillez réessayer.',
123130

‎packages/i18n/src/translations/hi-IN.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'प्रोफ़ाइल',
120+
121+
'user.profile.loading': 'प्रोफ़ाइल लोड हो रही है',
122+
123+
'user.profile.readonly.federated':
124+
'यह प्रोफ़ाइल आपके {provider} खाते द्वारा प्रबंधित है और इसे यहाँ संपादित नहीं किया जा सकता।',
125+
126+
'user.profile.update.not.allowed.error':
127+
'आपकी प्रोफ़ाइल आपके पहचान प्रदाता द्वारा प्रबंधित है, इसलिए ये विवरण यहाँ नहीं बदले जा सकते।',
120128
'user.profile.update.generic.error': 'प्रोफ़ाइल अपडेट करते समय त्रुटि हुई। कृपया पुनः प्रयास करें।',
121129

122130
/* |---------------------------------------------------------------| */

‎packages/i18n/src/translations/ja-JP.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'プロフィール',
120+
121+
'user.profile.loading': 'プロフィールを読み込んでいます',
122+
123+
'user.profile.readonly.federated':
124+
'このプロフィールは {provider} アカウントで管理されているため、ここでは編集できません。',
125+
126+
'user.profile.update.not.allowed.error':
127+
'プロフィールは ID プロバイダーによって管理されているため、ここでは変更できません。',
120128
'user.profile.update.generic.error': 'プロフィール更新中にエラーが発生しました。もう一度お試しください。',
121129

122130
/* |---------------------------------------------------------------| */

‎packages/i18n/src/translations/pt-BR.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'Perfil',
120+
121+
'user.profile.loading': 'Carregando perfil',
122+
123+
'user.profile.readonly.federated': 'Este perfil é gerenciado pela sua conta {provider} e não pode ser editado aqui.',
124+
125+
'user.profile.update.not.allowed.error':
126+
'Seu perfil é gerenciado pelo seu provedor de identidade, portanto esses dados não podem ser alterados aqui.',
120127
'user.profile.update.generic.error': 'Ocorreu um erro ao atualizar seu perfil. Tente novamente.',
121128

122129
/* |---------------------------------------------------------------| */

‎packages/i18n/src/translations/pt-PT.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'Perfil',
120+
121+
'user.profile.loading': 'A carregar o perfil',
122+
123+
'user.profile.readonly.federated': 'Este perfil é gerido pela sua conta {provider} e não pode ser editado aqui.',
124+
125+
'user.profile.update.not.allowed.error':
126+
'O seu perfil é gerido pelo seu fornecedor de identidade, pelo que estes dados não podem ser alterados aqui.',
120127
'user.profile.update.generic.error': 'Ocorreu um erro ao actualizar o seu perfil. Tente novamente.',
121128

122129
/* |---------------------------------------------------------------| */

‎packages/i18n/src/translations/si-LK.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'පැතිකඩ',
120+
121+
'user.profile.loading': 'පැතිකඩ පූරණය වෙමින්',
122+
123+
'user.profile.readonly.federated':
124+
'මෙම පැතිකඩ ඔබගේ {provider} ගිණුම මගින් කළමනාකරණය වන අතර මෙහිදී සංස්කරණය කළ නොහැක.',
125+
126+
'user.profile.update.not.allowed.error':
127+
'ඔබගේ පැතිකඩ ඔබගේ අනන්‍යතා සපයන්නා විසින් කළමනාකරණය කරන බැවින්, මෙම විස්තර මෙහිදී වෙනස් කළ නොහැක.',
120128
'user.profile.update.generic.error': 'ඔබේ පැතිකඩ යාවත්කාලීන කිරීමේදී දෝෂයක් ඇතිවිය.කරුණාකර නැවත උත්සාහ කරන්න',
121129

122130
/* |---------------------------------------------------------------| */

‎packages/i18n/src/translations/ta-IN.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ const translations: I18nTranslations = {
117117
/* |---------------------------------------------------------------| */
118118

119119
'user.profile.heading': 'சுயவிவரம்',
120+
121+
'user.profile.loading': 'சுயவிவரம் ஏற்றப்படுகிறது',
122+
123+
'user.profile.readonly.federated':
124+
'இந்தச் சுயவிவரம் உங்கள் {provider} கணக்கால் நிர்வகிக்கப்படுகிறது, இங்கே திருத்த முடியாது.',
125+
126+
'user.profile.update.not.allowed.error':
127+
'உங்கள் சுயவிவரம் அடையாள வழங்குநரால் நிர்வகிக்கப்படுகிறது, எனவே இந்த விவரங்களை இங்கே மாற்ற முடியாது.',
120128
'user.profile.update.generic.error':
121129
'உங்கள் சுயவிவரத்தை புதுப்பிக்கும் போது பிழை ஏற்பட்டது. மீண்டும் முயற்சிக்கவும்.',
122130

0 commit comments

Comments
 (0)