This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit bf7cd97d authored by Eduard Frankford's avatar Eduard Frankford
Browse files

Merge branch 'keycloak_theme_update' into 'development'

Keycloak theme update

See merge request sharing/codeability-sharing-platform!186
parents da9815fd 7dce945a
Branches
3 merge requests!188Merging Peer Reviewing et. al to Master,!187Just remerging from dev before final merge,!186Keycloak theme update
......@@ -38,6 +38,9 @@ services:
# - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app
ports:
- 10084:8080
logging:
options:
max-size: 50m
depends_on:
- keycloak
- sharing_mysql
......@@ -51,6 +54,9 @@ services:
hostname: sharing_mysql
volumes:
- '$MYSQL_HOME:/var/lib/mysql/'
logging:
options:
max-size: 50m
environment:
- MYSQL_USER=root
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
......@@ -63,6 +69,9 @@ services:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
logging:
options:
max-size: 50m
environment:
- POSTGRES_DB=keycloak
- POSTGRES_USER=${POSTGRES_USER_KEYCLOAK}
......@@ -91,6 +100,9 @@ services:
#JDBC_PARAMS: "ssl=true"
ports:
- 8082:8080
logging:
options:
max-size: 50m
restart: always
volumes:
- $GITSEARCH_PATH/src/main/resources/keycloak-theme/themes/gitsearch:/opt/jboss/keycloak/themes/gitsearch
......
......@@ -94,7 +94,12 @@ public class UserDetailsFetcher {
}
String email = (String) oidcUser.getAttribute("email");
User gitUser = gitLabApi.getUserApi().getUserByEmail(email);
User gitUser = null;
try {
gitUser = gitLabApi.getUserApi().getUserByEmail(email);
} catch (IllegalArgumentException e) {
logger.warn("Cannot fetch details for user {}", email, e);
}
if (gitUser == null) {
// try to create the user
......
......@@ -82,25 +82,33 @@
</div>
</#if>
<#elseif section = "socialProviders" >
<#if realm.password && social.providers??>
<#if realm.password && social.providers?? && social.providers?size gt 0>
<div id="kc-social-providers" class="${properties.kcFormSocialAccountSectionClass!}">
<ul class="${properties.kcFormSocialAccountListClass!} <#if social.providers?size gt 3>${properties.kcFormSocialAccountListGridClass!}</#if>">
<#list social.providers as p>
<a id="social-${p.alias}" class="${properties.kcFormSocialAccountListButtonClass!} <#if social.providers?size gt 3>${properties.kcFormSocialAccountGridItem!}</#if>"
type="button" href="${p.loginUrl}">
<#if p.iconClasses?has_content>
<i class="${properties.kcCommonLogoIdP!} ${p.iconClasses!}" aria-hidden="true"></i>
<span class="${properties.kcFormSocialAccountNameClass!} kc-social-icon-text">${p.displayName!}</span>
<#else>
<span class="${properties.kcFormSocialAccountNameClass!}">${p.displayName!}</span>
</#if>
</a>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<style>
#social-providers-dropdown {
width: 300px!important; /* You can set this value based on your layout needs */
}
</style>
<select id="social-providers-dropdown" class="${properties.kcFormSocialAccountListClass!} select2-dropdown">
<option style="width: 300px!important;" selected>Select a Social Provider</option>
<#list social.providers?sort_by("displayName") as p>
<option style="width: 300px!important;" value="${p.loginUrl}">${p.displayName!}</option>
</#list>
</ul>
</select>
<script type="text/javascript">
$(document).ready(function() {
$('.select2-dropdown').select2();
$('#social-providers-dropdown').on('select2:select', function (e) {
window.location.href = e.params.data.id;
});
});
</script>
</div>
</#if>
</#if>
</@layout.registrationLayout>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment