use of com.gitblit.auth.RedmineAuthProvider in project gitblit by gitblit.
the class RedmineAuthenticationTest method newAuthenticationManager.
AuthenticationManager newAuthenticationManager() {
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(getSettings(), xssFilter, GitBlitSuite.BASEFOLDER).start();
UserManager users = new UserManager(runtime, null).start();
RedmineAuthProvider redmine = new RedmineAuthProvider();
redmine.setup(runtime, users);
redmine.setTestingCurrentUserAsJson(JSON);
AuthenticationManager auth = new AuthenticationManager(runtime, users);
auth.addAuthenticationProvider(redmine);
return auth;
}
use of com.gitblit.auth.RedmineAuthProvider in project gitblit by gitblit.
the class RedmineAuthenticationTest method testAuthenticate.
@Test
public void testAuthenticate() throws Exception {
RedmineAuthProvider redmine = newRedmineAuthentication();
redmine.setTestingCurrentUserAsJson(JSON);
UserModel userModel = redmine.authenticate("RedmineAdminId", "RedmineAPIKey".toCharArray());
assertThat(userModel.getName(), is("redmineadminid"));
assertThat(userModel.getDisplayName(), is("baz foo"));
assertThat(userModel.emailAddress, is("baz@example.com"));
assertNotNull(userModel.cookie);
}
use of com.gitblit.auth.RedmineAuthProvider in project gitblit by gitblit.
the class RedmineAuthenticationTest method newRedmineAuthentication.
RedmineAuthProvider newRedmineAuthentication(IStoredSettings settings) {
XssFilter xssFilter = new AllowXssFilter();
RuntimeManager runtime = new RuntimeManager(settings, xssFilter, GitBlitSuite.BASEFOLDER).start();
UserManager users = new UserManager(runtime, null).start();
RedmineAuthProvider redmine = new RedmineAuthProvider();
redmine.setup(runtime, users);
return redmine;
}
Aggregations