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

net.xwzhou.commons.token.ClientInterceptor Maven / Gradle / Ivy

The newest version!
package net.xwzhou.commons.token;

import net.xwzhou.commons.jfinal.BaseController;
import net.xwzhou.commons.jfinal.Code;
import net.xwzhou.commons.jfinal.interceptor.BaseInterceptor;
import net.xwzhou.commons.utils.Assert;

public class ClientInterceptor extends BaseInterceptor {

	protected boolean preHandle(BaseController controller) throws Exception {
		String clientId = controller.getParaNotNull("client_id");
		String clientSecret = controller.getParaNotNull("client_secret");
		Assert.checkNotNull(Client.dao.query(clientId, clientSecret), Code.OAUTH2_CLIENT_INVALID);
		return super.preHandle(controller);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy