Skip to content
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

Declarative User Profile export #12062

Closed
Tracked by #23905
simse07 opened this issue May 18, 2022 · 1 comment · Fixed by #24147
Closed
Tracked by #23905

Declarative User Profile export #12062

simse07 opened this issue May 18, 2022 · 1 comment · Fixed by #24147
Assignees
Labels
Milestone

Comments

@simse07
Copy link

simse07 commented May 18, 2022

Description

The realm export via admin console, should include the defined declarative user profile.

Discussion

#11541

Motivation

The declarative user profile is a really nice feature, but migrating a realm from one stage to another will require more manual effort without this feature.

Details

The UserProfileProvider is correctly exported with declarative-user-profile but the config is empty:

"org.keycloak.userprofile.UserProfileProvider": [
      {
        "id": "88cef18c-bcd8-40d2-9e7d-d257298317f2",
        "providerId": "declarative-user-profile",
        "subComponents": {},
        "config": {}
      }
    ],

I would expect that the config would contain the defined user attributes.

@simse07 simse07 added kind/enhancement Categorizes a PR related to an enhancement status/triage labels May 18, 2022
@MartijnPDirekt
Copy link

MartijnPDirekt commented Mar 22, 2023

Importing is possible using the below structure as config. I expect the same thing to be there upon export.
I have added an additional validation at the 'email' attribute to be able to see the difference upon importing the realm.

Discovered this solution with the help of #8872

"config": {        
    "config-piece-0" : [ "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}}},{\"name\":\"email\",\"displayName\":\"${email}\",\"permissions\":{\"edit\":[\"admin\",\"user\"],\"view\":[\"admin\",\"user\"]},\"validations\":{\"email\":{},\"length\":{\"max\":255},\"pattern\":{\"pattern\":\"[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~.-]+@example.nl\",\"error-message\":\"Invalid domain selected\"}},\"annotations\":{\"\":\"\"},\"required\":{\"roles\":[\"user\"]},\"group\":null},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}}},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}}}]}" ],
    "config-pieces-count" : [ "1" ]
}

@vramik vramik self-assigned this Oct 10, 2023
@pedroigor pedroigor added this to the 23.0.0 milestone Oct 11, 2023
@vramik vramik added kind/bug Categorizes a PR related to a bug and removed kind/enhancement Categorizes a PR related to an enhancement labels Oct 12, 2023
vramik added a commit to vramik/keycloak that referenced this issue Oct 16, 2023
@ghost ghost added the team/core label Oct 18, 2023
vramik added a commit to vramik/keycloak that referenced this issue Oct 19, 2023
vramik added a commit to vramik/keycloak that referenced this issue Oct 19, 2023
vramik added a commit to vramik/keycloak that referenced this issue Oct 20, 2023
ahus1 pushed a commit that referenced this issue Oct 21, 2023
Yang-Xie-OSS pushed a commit to Hitachi/keycloak that referenced this issue Nov 21, 2023
Yang-Xie-OSS pushed a commit to Hitachi/keycloak that referenced this issue Nov 22, 2023
srose pushed a commit to srose/keycloak that referenced this issue Dec 20, 2023
kamontat pushed a commit to kamontat/keycloak that referenced this issue Jan 20, 2024
Closes keycloak#12062
Resolves keycloak#20885

Signed-off-by: Kamontat Chantrachirathumrong <14089557+kamontat@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants