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

org.zbus.mq.server.auth.DefaultAuth Maven / Gradle / Ivy

There is a newer version: 7.2.2
Show newest version
package org.zbus.mq.server.auth;

public class DefaultAuth implements Auth{
	private String accessToken = "";
	public DefaultAuth(String accessToken){
		if(accessToken == null){
			accessToken = "";
		}
		this.accessToken = accessToken;
	}
	@Override
	public boolean auth(String appid, String token) {
		if(token == null) token = ""; //null assumed to be empty
		return accessToken.equals(token);
	}
	public void setAccessToken(String accessToken) {
		if(accessToken == null){ //null assumed to be empty
			accessToken = "";
		}
		this.accessToken = accessToken;
	} 
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy