\r
import com.gitblit.models.UserModel;\r
import com.gitblit.utils.ConnectionUtils;\r
+import com.gitblit.utils.StringUtils;\r
import com.google.gson.Gson;\r
\r
/**\r
return false;\r
}\r
\r
- @Override\r
- public boolean supportsCookies() {\r
- return false;\r
- }\r
-\r
@Override\r
public UserModel authenticate(String username, char[] password) {\r
String urlText = this.settings.getString(Keys.realm.redmine.url, "");\r
userModel.displayName = current.user.firstname + " " + current.user.lastname;\r
userModel.emailAddress = current.user.mail;\r
userModel.canAdmin = true;\r
+ userModel.cookie = StringUtils.getSHA1(userModel.username + new String(password));\r
return userModel;\r
}\r
\r
package com.gitblit.tests;\r
\r
import static org.hamcrest.CoreMatchers.is;\r
+import static org.junit.Assert.assertNotNull;\r
import static org.junit.Assert.assertNull;\r
import static org.junit.Assert.assertThat;\r
\r
assertThat(userModel.getName(), is("RedmineUserId"));\r
assertThat(userModel.getDisplayName(), is("baz foo"));\r
assertThat(userModel.emailAddress, is("baz@example.com"));\r
+ assertNotNull(userModel.cookie);\r
}\r
\r
@Test\r