leaonline:accounts-lea

v2.0.0Published 3 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor accounts lea

This package allows to call Meteor.loginWithLea which triggers an oauth2 authorization code worklow that you control using the leaonline:oauth2-server in a standalone oauth2 server Meteor application.

Check the leaonline:oauth2-server package for a detailed documentation on the configuration.

Installation

You need to install this on the client app that wants to consume the OAuth2 server's capabilities:

$ meteor add leaonline:accounts-lea

Then you need to configure the service on your server startup:

If you want to login in with lea your client app needs to define the ServiceConfiguration:

1/* global ServiceConfiguration */
2import { Meteor } from 'meteor/meteor'
3
4Meteor.startup(() => {
5  const { oauth } = Meteor.settings
6  ServiceConfiguration.configurations.upsert(
7    { service: 'lea' }, // required
8    {
9      $set: {
10        // required fields:
11        loginStyle: 'popup',
12        clientId: oauth.clientId,
13        secret: oauth.secret,
14        dialogUrl: oauth.dialogUrl,
15        accessTokenUrl: oauth.accessTokenUrl,
16        identityUrl: oauth.identityUrl,
17        redirectUrl: oauth.redirectUrl,
18        // additional fields injected into profile
19        // optional; these are just examples:
20        identity: [
21          'firstName',
22           'lastName',
23        ],       
24        
25        // additional fields, injected into user.services.lea
26        // optional; these are just examples:
27        extraFields: [
28          'roles'
29        ]
30      }
31    }
32  )
33})

The oauth fields are required fields for the service to work. Check the leaonline:oauth2-server package for a detailed documentation on the configuration.

License

MIT, see license file