The initial package which became accounts-drupal. Please use accounts-drupal instead. https://github.com/FGM/accounts-drupal
Frederic G. MARAND 6df6fa9719 f | 9 년 전 | |
---|---|---|
client | 9 년 전 | |
lib | 9 년 전 | |
server | 9 년 전 | |
.jshintrc | 9 년 전 | |
README.md | 9 년 전 | |
drupal-sso-tests.js | 9 년 전 | |
package.js | 9 년 전 |
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.