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

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

There is a newer version: 2.1.115
Show newest version
package com.untzuntz.ustackserverapi.auth;

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

import org.apache.log4j.Logger;
import org.jboss.netty.handler.codec.http.HttpRequest;

import com.untzuntz.ustackserverapi.APIException;
import com.untzuntz.ustackserverapi.CallParameters;
import com.untzuntz.ustackserverapi.MethodDefinition;
import com.untzuntz.ustackserverapi.params.types.ParameterDefinitionInt;

/**
 * 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