summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-09-04 09:56:17 -0600
committerJames Moger <james.moger@gitblit.com>2014-09-04 09:56:17 -0600
commit913daf602ec0535d272140a2a5f96dffbd49b97e (patch)
treea815d5a362b7a918e622c6ee9b3566e4a72c8db7 /src/main/java/com/gitblit
parent172f69bcdd28c5fbac94511d777ba1cd9d278feb (diff)
parent2445d4b2b80671bdcefbd4ed81f394a5249ee13d (diff)
downloadgitblit-913daf602ec0535d272140a2a5f96dffbd49b97e.tar.gz
gitblit-913daf602ec0535d272140a2a5f96dffbd49b97e.zip
Merged #143 "Fix url-based password keaing in Redmine auth provider"
Diffstat (limited to 'src/main/java/com/gitblit')
-rw-r--r--src/main/java/com/gitblit/auth/RedmineAuthProvider.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/auth/RedmineAuthProvider.java b/src/main/java/com/gitblit/auth/RedmineAuthProvider.java
index 7e957ecb..e505a54d 100644
--- a/src/main/java/com/gitblit/auth/RedmineAuthProvider.java
+++ b/src/main/java/com/gitblit/auth/RedmineAuthProvider.java
@@ -153,15 +153,16 @@ public class RedmineAuthProvider extends UsernamePasswordAuthenticationProvider
if (!url.endsWith("/")) {
url = url.concat("/");
}
+ String apiUrl = url + "users/current.json";
+
HttpURLConnection http;
if (username == null) {
// apikey authentication
String apiKey = String.valueOf(password);
- String apiUrl = url + "users/current.json?key=" + apiKey;
http = (HttpURLConnection) ConnectionUtils.openConnection(apiUrl, null, null);
+ http.addRequestProperty("X-Redmine-API-Key", apiKey);
} else {
// username/password BASIC authentication
- String apiUrl = url + "users/current.json";
http = (HttpURLConnection) ConnectionUtils.openConnection(apiUrl, username, password);
}
http.setRequestMethod("GET");