Skip to content

Commit

Permalink
Fixed bug randomly introduced by SFCC and undocumented where they sta…
Browse files Browse the repository at this point in the history
…rted requireing the credentials to be URLEncoded before they are used as Basic HTTP Auth
  • Loading branch information
danechitoaie committed Feb 26, 2020
1 parent c5e559e commit 6f45f3d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
23 changes: 5 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.6</version>
<version>3.56</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -43,7 +43,7 @@
<properties>
<jdk.version>1.8</jdk.version>
<java.level>8</java.level>
<jenkins.version>2.107.1</jenkins.version>
<jenkins.version>2.164.1</jenkins.version>
</properties>

<build>
Expand All @@ -65,23 +65,10 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.16</version>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
<configuration>
<excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
</plugins>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.io.Reader;
import java.io.StringReader;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.cert.CertificateException;
import java.security.cert.CertificateExpiredException;
Expand Down Expand Up @@ -567,9 +568,9 @@ private AuthResponse auth() throws IOException {
Base64.getEncoder().encodeToString(
String.format(
"%s:%s",
ocCredentials.getClientId(),
ocCredentials.getClientPassword().getPlainText()
).getBytes(Consts.UTF_8)
URLEncoder.encode(ocCredentials.getClientId(), "UTF-8"),
URLEncoder.encode(ocCredentials.getClientPassword().getPlainText(), "UTF-8")
).getBytes(StandardCharsets.UTF_8)
)
));

Expand Down

0 comments on commit 6f45f3d

Please sign in to comment.