((https://atmospherejs.com/atoy40/accounts-cas)
- Added support of "redirect" instead of "popup window" (disable the popup window)
- Use xmlparser instead of newline parsing
cd ~site
mkdir packages
cd packages
git clone https://github.com/xaionaro/meteor-accounts-cas
cd ~site
meteor add xaionaro:accounts-cas
Put CAS settings in Meteor.settings (for example using METEOR_SETTINGS env or --settings) like so:
If casVersion is not defined, it will assume you use CAS 1.0. (note by xaionaro: option casVersion
seems to be just ignored in the code, ATM).
This package depends on NPM node-cas https://github.com/anrizal/node-cas which is forked from https://github.com/kcbanner/node-cas There is a pull-request to https://github.com/kcbanner/node-cas. If the pull-request accepted, anrizal promised to will change the dependency in his fork.
Server side settings:
Meteor.settings = {
"cas": {
"validateUrl": "https://cas.example.com/serviceValidate",
"autoClose": true,
"casVersion": 2.0,
"popup": true,
}
}
Client side settings:
Meteor.settings = {
"public": {
"cas": {
"loginUrl": "https://cas.example.com/login",
"serviceParam": "service",
"popupWidth": 810,
"popupHeight": 610,
"popup": true,
}
}
}
proxyUrl
is not required. Setup ROOT_URL environment variable instead.
Then, to start authentication, you have to call the following method from the client (for example in a click handler) :
Meteor.loginWithCas([callback]);
It must open a popup containing you CAS login form or redirect to the CAS login form (depending on "popup" setting).
If popup is disabled (== false), then it's required to execute Meteor.initCas([callback])
in Meteor.startup
of the client side. ATM, Meteor.initCas()
completes authentication.