CFML Security Validator
The CFML Security validator leverages the ColdFusion security functions for authentication and role based authorization.
Last updated
Was this helpful?
Was this helpful?
component{
function login( event, rc, prc ){
event.setView( "security/login" );
}
function doLogin( event, rc, prc ){
cflogin(
idletimeout=getSetting( "LoginTimeout" ),
applicationtoken=getSetting( "AppName" ),
cookiedomain='myapp.com'
){
cfoauth(
type = "Google",
clientid = "YOUR_CLIENT_ID",
secretkey = "YOUR_GOOGLE_CLIENTSECRET",
redirecturi = "YOUR_CALLBACK_URI",
result = "res",
scope = "YOUR_SCOPES",
state = "cftoken=#cftoken#"
);
cfloginuser(
name = "#res.other.email#",
password = "#res.access_token#",
roles = "user"
);
}
}
function doLogout( event, rc, prc ){
cflogout();
relocate( "security.login" );
}
}