All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payneteasy.superfly.jira.provider.SuperflyCredentialsProvider Maven / Gradle / Ivy

There is a newer version: 1.6-5
Show newest version
package com.payneteasy.superfly.jira.provider;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.user.provider.CredentialsProvider;
import com.payneteasy.superfly.api.SSOUserWithActions;

/**
 * Superfly-related {@link CredentialsProvider} implementation.
 * 
 * @author Roman Puchkovskiy
 */
public class SuperflyCredentialsProvider extends BaseSuperflyUserProvider implements
		CredentialsProvider {
	
	public boolean handles(String username) {
		return getUserStore().userExists(username);
	}
	
	@Override
	public List list() {
		List userNames = new ArrayList();
		for (SSOUserWithActions user : getUserStore().getUsers()) {
			userNames.add(user.getName());
		}
		return userNames;
	}

	public boolean authenticate(String username, String password) {
		// NOTE: not sure is this ok, but this seems to work, possibly because
		// user has already been authenticated by Authenticator. Superfly
		// authentication is heavy, so we cannot re-authenticate user on any
		// action...
		return false;
	}

	public boolean changePassword(String username, String password) {
		// modifications are not supported
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy