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

com.textrecruit.ustackserverapi.auth.APIClientKeyAuth Maven / Gradle / Ivy

There is a newer version: 1.0.31
Show newest version
package com.textrecruit.ustackserverapi.auth;

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

import com.textrecruit.ustackserverapi.params.types.ParameterDefinitionInt;
import org.apache.log4j.Logger;
import org.jboss.netty.handler.codec.http.HttpRequest;

import com.textrecruit.ustackserverapi.APIException;
import com.textrecruit.ustackserverapi.CallParameters;
import com.textrecruit.ustackserverapi.MethodDefinition;

/**
 * Validates an API client ID and API key via HTTP Basic Auth
 * 
 * @author jdanner
 *
 */
public class APIClientKeyAuth implements AuthenticationInt {

    static Logger           		logger               	= Logger.getLogger(APIClientKeyAuth.class);

    public String getAuthenticationDescription() {
    	return "Your client ID/API Key via HTTP Basic Authentication required.";
    }

    public boolean isBasicAuth() {
    	return true;
    }
    
    public List> getAuthenticationParameters() {
    	
    	List> ret = new ArrayList>();
    	return ret;
    }

	@Override
	public Boolean authenticate(MethodDefinition method, HttpRequest req, CallParameters params) throws APIException {
		ClientKeyAuthBase.authenticate(method, req, params);
		return true;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy