Skip to content

s-KaiNet/passport-sharepoint-addin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passport.js authentication middleware for SharePoint add-in

Need help on SharePoint with Node.JS? Join our gitter chat and ask question! Gitter chat

Passport.js authentication strategy for SharePoint Online and SharePoint on-premise performing authentication via ACS.

This module allows you to perform SharePoint add-in authentication for your Node.js Express web application. Can be also integrated into other connect-based frameworks.

Install

npm install passport-sharepoint-addin

Usage

For detailed in-depth tutorial and configuration workflow please visit sample here - Express SharePoint add-in sample.

Basic setup

passport.use(new SharePointAddinStrategy({clientId: '', clientSecret: ''}, 'https://site.com/auth/sharepoint/callback', (profile: ISharePointProfile) => {
        return User.findOne({ 'sharepoint.loginName': profile.loginName })
            .then(user => {
                if (user) {
                    return user;
                }

                const newUser = new User();
                newUser.sharepoint.email = profile.email;
                newUser.sharepoint.loginName = profile.loginName;
                newUser.sharepoint.displayName = profile.displayName;
                return newUser.save();
            });
    }));

About

Passport.js authentication middleware for SharePoint add-in

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published