The initial package which became accounts-drupal. Please use accounts-drupal instead. https://github.com/FGM/accounts-drupal
Frederic G. MARAND 6df6fa9719 f | 9 years ago | |
---|---|---|
client | 9 years ago | |
lib | 9 years ago | |
server | 9 years ago | |
.jshintrc | 9 years ago | |
README.md | 9 years ago | |
drupal-sso-tests.js | 9 years ago | |
package.js | 9 years ago |
The Drupal SSO package provides transparent authentication integration with a Drupal instance.
meteor add fgm:drupal-sso
Configure a drupal-sso
section in your settings.json
, like:
{
'drupal-sso': {
"site": "http://example.com",
"appToken": "the application token you got from the Meteor module"
}
}
In the app startup, initialize a SSO instance: SSO = new DrupalSSO();
.
client/lib/init.js
to be sure it happens as early as possible.In your template helpers, expose that variable: Spacebars apparently cannot see variables, like this:
Template.some_template_name.helpers({
sso: function () {
return SSO;
},
});
Once this is done, your application can use the SSO methods, passive and reactive data sources:
userId()
, userName()
, userRoles()
state.sessionName
, state.anonymousName
, state.online
You may delay until initialization by the Drupal server has completed by waiting on SSO.state.online
until it is no longer undefined
.
Unlike Meteor, Drupal relies by default on cookie-based authentication. This package makes use of the Drupal session cookie to authenticate the user with the Drupal instance having created the cookie.
It enables adding Meteor pages to a Drupal site without having to care for authentication, which is carried over from Drupal for each logged-in user.