-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleConfig.cfc
86 lines (75 loc) · 2.14 KB
/
ModuleConfig.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
* www.ortussolutions.com
* ---
*/
component {
// Module Properties
this.title = "cbSSO";
this.author = "Ortus Solutions";
this.webURL = "https://www.ortussolutions.com";
this.description = "@MODULE_DESCRIPTION@";
this.version = "@build.version@+@build.number@";
// Model Namespace
this.modelNamespace = "cbsso";
this.autoMapModels = true;
// CF Mapping
this.cfmapping = "cbSSO";
this.entryPoint = "/cbsso";
// Dependencies
this.dependencies = [ "hyper", "jwtcfml" ];
routes = [
{
pattern : "/auth/:providerName/start",
handler : "Auth",
action : "start"
},
{
pattern : "/auth/:providerName",
handler : "Auth",
action : "authorize"
}
];
/**
* Configure Module
*/
function configure(){
settings = {
enableCBAuthIntegration : false,
errorRedirect : "",
successRedirect : "",
providers : [
// Your google login API credentials
// "google": {
// clientId : getSystemSetting( key = "GOOGLE_CLIENT_ID", defaultValue = "" ),
// clientSecret : getSystemSetting( key = "GOOGLE_CLIENT_SECRET", defaultValue = "" ),
// authEndpoint : "https://accounts.google.com/o/oauth2/v2/auth",
// accessTokenEndpoint : "https://www.googleapis.com/oauth2/v4/token",
// redirectUri : getSystemSetting( key = "GOOGLE_REDIRECT_URI", defaultValue = "" )
// }
]
};
interceptorSettings = { customInterceptionPoints : [ "CBSSOMissingProvider", "CBSSOAuthorization" ] };
};
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
// Register all app disks
wirebox.getInstance( "ProviderService@cbsso" ).registerProviders();
if ( settings.enableCBAuthIntegration ) {
controller
.getInterceptorService()
.registerInterceptor(
interceptorClass = "cbsso.interceptors.cbAuth",
interceptorProperties = settings,
interceptorName = "cbsso@global"
);
}
}
/**
* Fired when the module is unregistered and unloaded
*/
function onUnload(){
}
}