SIMS is a very basic project aims to add social login as a method of authentication and authorization to wireless networks managed by Cisco ISE. It's built on top of Node.js/Express and use Passport.js to easily add more than 500 social login strategies
For a quick start you'll don't need to have any network setup or equiqments, we will use the default configuration and test portals. so the must have list include only:
Desktop
/VM
/Server
with Node.js v8.9.3+/Docker installed
# Clone this repository $ git clone https://github.com/CiscoDevNet/ise-social-login-guest-authentication.git # Go into the repository $ cd sims # Install dependencies (skip it in case you plan run on docker) $ npm i
SIMS is using environment variables for configuration. the easiest way to manage and persist them is using the .env
file sits on the root project directory
Configuration in the file is splitted to three parts, listed below
NODE_TLS_REJECT_UNAUTHORIZED=0 // Get access to Cisco ISE with no SSL cert installed CALLBACK_HOSTNAME= // Hostname that we will run our server, used for callback redirection PORT= // Port we will run our server
ISE_ADDRESS=// IP Address of our Cisco ISE PAN node ISE_SPONSOR_USER_NAME=// Sponsor user that will create our guest users ISE_SPONSOR_PASSWORD=// Password for the sponsor user SPONSOR_PORTAL_ID= // Sponsor portal that guest will be part of GUEST_USER_LOCATION=// The location where the guest user created
SIMS is use by default four social login strategies. For strategies modifications refer to Add/Remove Login Strategies section below. Pay attention that missing config property will fail the application
LINKEDIN_CLIENT_ID= LINKEDIN_SECRET= GITHUB_CLIENT_ID= GITHUB_SECRET= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= TWITTER_CONSUMER_KEY= TWITTER_CONSUMER_SECRET=
.env
file is listed as.gitignore
file to avoid commiting of sensitive data to source control
From the project directory, Run:
npm start
for a quick up'n'runningnpm run dev
to use nodemon and modify the code in realtimeThis project has both Dockerfile
and docker-compose.yml
files to allow plain docker and docker-swarm running env
From the project directory, Run:
docker run --rm -it -p 3001:3001 $(docker build -q --no-cache .)
to build docker image and run it on port 3001Administration > System > Settings > ERS Settings
Enable ERS forRead/Write
Save
Administration > Identities > Users
Add
Name
(Usually sponsor-api)Password
(Choosen password)ALL_ACCOUNTS (default)
at User Groups
dropdownSubmit
Work Centers > Guest Access > Portals & Components > Sponsor Groups > ALL_ACCOUNTS (default)
Access Cisco ISE guest accounts using the programmatic interface (Guest REST API)
Save
Work Centers > Guest Access > Portals & Components > Sponsor Portals > Sponsor Portal (default)
Portal test URL
portal
value from the address bar (should look like 5d6c7720-f612-43df-ad36-ecfb166de8be
)portal
value on .env
fileWork Centers > Guest Access > Settings > Guest Locations and SSIDs
Location name:*
(Free text)Time zone:*
Add
Save
location name
value on .env
fileThe sample below will add all the four default login methods to the portal, refer to Add/Remove Login Strategies section for more info
Work Centers > Guest Access > Portals & Components > Guest Portals > Self-Registered Guest Portal (default)
Portal Page Customization
Instructional Text
sectionToggle HTML Source
(a button with icon looks like <>
appear on the bottom row of the editor sidebar)<button onclick="window.location.href='http://localhost:3001/auth/google'+window.location.search+'&iseAddress='+window.location.host+'&token='+document.getElementsByName('token')[0].value">Login with Google</button> <button onclick="window.location.href='http://localhost:3001/auth/twitter'+window.location.search+'&iseAddress='+window.location.host+'&token='+document.getElementsByName('token')[0].value">Login with Twitter</button> <button onclick="window.location.href='http://localhost:3001/auth/linkedin'+window.location.search+'&iseAddress='+window.location.host+'&token='+document.getElementsByName('token')[0].value">Login with LinkedIn</button> <button onclick="window.location.href='http://localhost:3001/auth/github'+window.location.search+'&iseAddress='+window.location.host+'&token='+document.getElementsByName('token')[0].value">Login with Github</button>
Work Centers > Guest Access > Portal & Components > Guest Portals > Self-Registered Guest Portal (default)
Portal Test URL
Login with GitHub
(or any other method you have)Accept
Work Centers > Guest Access > Manage Accounts
Manage Accounts
Managed Accounts
tabOne of the advantages of using social network as login method is the extra attributes we can get on our guest users. We can use this attributes to make policy desicion. (e.g. take the account age as proof for account validation, guest age for legal purpose etc.), marketing insights (e.g. push user profile to our CRM), user targeting/profiling and more
To manage the extra field that will populate we will use the userSerializer.js
file where we manage the serialization of guest users from various social identities
The current version of SIMS implemented four social login methods, there is no reason why we choose to implement only those, you can use it or not
To add or remove the
Location isn't fit
Custom field does not created
Passwords not match
Owner
Contributors
Categories
Products
Identity Services EngineProgramming Languages
JavaScriptLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community