Skip to content

Commit

Permalink
Align to Keycloak 14.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lscorcia committed Jun 20, 2021
1 parent cadd205 commit b6f0847
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target
.settings
.project
.classpath
.vscode

# OS generated files #
######################
Expand All @@ -37,3 +38,13 @@ activemq-data

# Extra #
#########
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ As far as I know it has not been used in Production in any environment yet.

Until the project gets to a stable release, it will be targeting the most recent release
of Keycloak as published on the website (see property `version.keycloak` in file `pom.xml`).
Currently the main branch is targeting Keycloak 13.0.0. **Do not use this provider with previous
Currently the main branch is targeting Keycloak 14.0.0. **Do not use this provider with previous
versions of Keycloak, it won't work!**

If you are evaluating this solution, my suggestion is to test the provider by compiling Keycloak
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.keycloak>13.0.0</version.keycloak>
<version.keycloak>14.0.0</version.keycloak>
<slf4j-api.version>1.7.30</slf4j-api.version>
<junit.version>4.13.1</junit.version>
<junit.version>4.13.2</junit.version>
</properties>

<scm>
<developerConnection>scm:git:https://github.com/lscorcia/keycloak-spid-provider.git</developerConnection>
<developerConnection>scm:git:https://github.com/italia/spid-keycloak-provider.git</developerConnection>
<tag>HEAD</tag>
</scm>

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/keycloak/broker/spid/SpidSAMLEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import java.net.URI;
import java.security.cert.CertificateException;

import java.util.Collections;
import javax.ws.rs.core.MultivaluedMap;
import javax.xml.crypto.dsig.XMLSignature;

Expand Down Expand Up @@ -564,9 +565,9 @@ protected Response handleLoginResponse(String samlResponse, SAMLDocumentHolder h
private AuthenticationSessionModel samlIdpInitiatedSSO(final String clientUrlName) {
event.event(EventType.LOGIN);
CacheControlUtil.noBackButtonCacheControlHeader();
Optional<ClientModel> oClient = SpidSAMLEndpoint.this.realm.getClientsStream()
.filter(c -> Objects.equals(c.getAttribute(SamlProtocol.SAML_IDP_INITIATED_SSO_URL_NAME), clientUrlName))
.findFirst();
Optional<ClientModel> oClient = SpidSAMLEndpoint.this.session.clients()
.searchClientsByAttributes(realm, Collections.singletonMap(SamlProtocol.SAML_IDP_INITIATED_SSO_URL_NAME, clientUrlName), 0, 1)
.findFirst();

if (! oClient.isPresent()) {
event.error(Errors.CLIENT_NOT_FOUND);
Expand Down

0 comments on commit b6f0847

Please sign in to comment.