/meteor-accounts-microsoft

A login service for Microsoft accounts.

Primary LanguageJavaScriptMIT LicenseMIT

Accounts Microsoft meteor package

A login service for Microsoft accounts

Build Status

Getting started

Add the package to meteor

meteor add q42:accounts-microsoft

Basic usage

The usage is pretty much the same as all other account packages for meteor. It's inspired by the official Accounts Google meteor package. It goes a little bit something like this:

Meteor.loginWithMicrosoft({
    requestOfflineToken: true,
    requestPermissions: ['wl.emails'] // Permission scopes are found here: https://msdn.microsoft.com/en-us/library/hh243648.aspx
}, function(error) {
    if (error) {
        console.error('Login failed:', error.reason || error);
    }
    else {
        console.log('Logged in!');
    }
});

You can also use the Meteor accounts-ui package so you only have to add;

{{> loginButtons}}

to your HTML.

Options object

var options = {
    // Whether or not to fetch a refresh token
    requestOfflineToken: true,
    // Permission scopes. 
    // All possible scopes are found here: https://msdn.microsoft.com/en-us/library/hh243648.aspx
    requestPermissions: [], 
    // Whatever paramteres you want to give to the authentication url. 
    // All possibilities can be found here: // https://msdn.microsoft.com/en-us/library/office/dn659750.aspx
    loginUrlParameters: [], 
    loginStyle: "popup" or "redirect",
    redirectUrl: ""
}

References

Official meteor documentation

OAuth package

Microsoft REST documentation