From 89053fc23657e87736f6b5324cf9d82815b2aa51 Mon Sep 17 00:00:00 2001 From: cgeorgilakis-grnet Date: Fri, 26 Apr 2024 15:42:09 +0300 Subject: [PATCH] extra ui fieldsfor Keycloak 22 --- README.md | 2 +- pom.xml | 2 +- .../orcid/OrcidIdentityProviderFactory.java | 17 +++++++++++++++++ .../messages/admin-messages_en.properties | 3 --- .../realm-identity-provider-orcid-ext.html | 14 -------------- .../partials/realm-identity-provider-orcid.html | 1 - 6 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 src/main/resources/theme-resources/messages/admin-messages_en.properties delete mode 100644 src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid-ext.html delete mode 100644 src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid.html diff --git a/README.md b/README.md index 2ebd2b4..27698b2 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Although ORCID can be configured as an OpenID Connect Identity Provider, the cur ## Compatibility Version 1.1.0 is compatible with Keycloak version 18.0.0 . -Version 1.2.0 is compatible with Keycloak version 22.0.0 . +Version 1.3.0 is compatible with Keycloak version 22.0.0 . ## Installation diff --git a/pom.xml b/pom.xml index 510fea0..5dc8a41 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.keycloak keycloak-orcid - 1.2.0 + 1.3.0 ${project.artifactId} ORCID as Social Provider in Keycloak diff --git a/src/main/java/org/keycloak/social/orcid/OrcidIdentityProviderFactory.java b/src/main/java/org/keycloak/social/orcid/OrcidIdentityProviderFactory.java index 131cf5f..2fb87ea 100644 --- a/src/main/java/org/keycloak/social/orcid/OrcidIdentityProviderFactory.java +++ b/src/main/java/org/keycloak/social/orcid/OrcidIdentityProviderFactory.java @@ -4,6 +4,10 @@ import org.keycloak.broker.social.SocialIdentityProviderFactory; import org.keycloak.models.IdentityProviderModel; import org.keycloak.models.KeycloakSession; +import org.keycloak.provider.ProviderConfigProperty; +import org.keycloak.provider.ProviderConfigurationBuilder; + +import java.util.List; public class OrcidIdentityProviderFactory extends AbstractIdentityProviderFactory implements SocialIdentityProviderFactory { @@ -28,4 +32,17 @@ public OrcidIdentityProviderConfig createConfig() { public String getId() { return PROVIDER_ID; } + + @Override + public List getConfigProperties() { + return ProviderConfigurationBuilder.create() + .property().name("baseUrl") + .label("Base Url") + .helpText("Base Url to ORCID Online API. Default to https://orcid.org/oauth.") + .type(ProviderConfigProperty.STRING_TYPE).add() + .property().name("userInfoUrl") + .label("User info") + .helpText("The User Info Url.Default to https://pub.orcid.org/v3.0.") + .type(ProviderConfigProperty.STRING_TYPE).add().build(); + } } \ No newline at end of file diff --git a/src/main/resources/theme-resources/messages/admin-messages_en.properties b/src/main/resources/theme-resources/messages/admin-messages_en.properties deleted file mode 100644 index a156f02..0000000 --- a/src/main/resources/theme-resources/messages/admin-messages_en.properties +++ /dev/null @@ -1,3 +0,0 @@ -orcid.base-url=Base Url -orcid.base-url.tooltip=Base Url to ORCID Online API. Default to https://orcid.org/oauth. -orcid.user-info-url.tooltip=The User Info Url. Default to https://pub.orcid.org/v3.0. \ No newline at end of file diff --git a/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid-ext.html b/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid-ext.html deleted file mode 100644 index 550d8a6..0000000 --- a/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid-ext.html +++ /dev/null @@ -1,14 +0,0 @@ -
- -
- -
- {{:: 'orcid.base-url.tooltip' | translate}} -
-
- -
- -
- {{:: 'orcid.user-info-url.tooltip' | translate}} -
\ No newline at end of file diff --git a/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid.html b/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid.html deleted file mode 100644 index a4630ac..0000000 --- a/src/main/resources/theme-resources/resources/partials/realm-identity-provider-orcid.html +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file