**Passport strategy for MGZon OAuth 2.0 authentication with icon support. is an OAuth 2.0 strategy for use with the Passport library, allowing authentication with MGZon.
This project simplifies the process of integrating MGZon authentication into your application using OAuth 2.0, enabling developers to authenticate users via their MGZon accounts.**
More Information
Check out the Gist for a quick start guide.
Passport-MGZon is an OAuth 2.0 strategy for use with the Passport library, allowing authentication with MGZon.
This project simplifies the process of integrating MGZon authentication into your application using OAuth 2.0, enabling developers to authenticate users via their MGZon accounts.
Demo Icon
MGZon Logo
How to Usage
- Authentication
const passport = require('passport');
const MGZonStrategy = require('passport-mgzon');
passport.use(new MGZonStrategy({
clientID: process.env.MGZON_CLIENT_ID,
clientSecret: process.env.MGZON_CLIENT_SECRET,
callbackURL: 'http://your-app/auth/mgz/callback',
scope: ['profile:read', 'profile:write']
}, async (accessToken, refreshToken, profile, done) => {
// Your user handling logic here
return done(null, profile);
}));
**_
- Routes _**
app.get('/auth/mgz', passport.authenticate('mgzon'));
app.get('/auth/mgz/callback', passport.authenticate('mgzon', { session: false }), (req, res) => {
res.redirect('/profile');
});
How to Use MGZon Icon
- This package includes the MGZon icon font. To use it:
Include the CSS:
- Include the CSS: Add the following line to your HTML or import it in your CSS/JS: html
<link rel="stylesheet" href="/icons/css/style.css">
<link rel="stylesheet" href="node_modules/passport-mgzon/icons/css/style.css">
- Use the Icon: Use the MGZon icon in your HTML:
<i class="icon-mgzon"></i> Sign in with MGZon
How to Installation
Install required packages:
npm install passport-mgzon
Top comments (0)