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

com.github.antelopeframework.remoting.server.auth.DefaultBasicAuthenticate Maven / Gradle / Ivy

The newest version!
package com.github.antelopeframework.remoting.server.auth;

import org.apache.commons.lang3.StringUtils;

import com.github.antelopeframework.remoting.server.HessianBase64;

import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Setter
public class DefaultBasicAuthenticate implements RemoteCallAuthenticate {
	
	String user;
	String password;
	
	public boolean basicAuth(String app, String basic) {
		if (log.isInfoEnabled()) {
			log.info("remote call: app={}, basic={}", app, basic);
		}
		
		if (StringUtils.equals("Basic " + HessianBase64.base64(user + ":" + password), basic)) {
			return true;
		}
		
		return false;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy