Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

passport-mgzon

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-mgzon

Passport strategy for authenticating with MGZon using OAuth 2.0

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Passport-MGZon

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

Requirements

  • Node.js and npm (or yarn)
  • Passport library
  • A MGZon account to access user data via OAuth 2.0.

Installation

1. Install required packages:

npm install passport-mgzon

## Usage

## Authentication


```bash
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);
}));

```bash

## Routes

```bash
app.get('/auth/mgz', passport.authenticate('mgzon'));

app.get('/auth/mgz/callback', passport.authenticate('mgzon', { session: false }), (req, res) => {
  res.redirect('/profile');
});

## MGZon Icon

- This package includes the MGZon icon font. To use it:

**Include the CSS:**

1. **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">

2. **Use the Icon**:
Use the MGZon icon in your HTML:

```bash
<i class="icon-mgzon"></i> Sign in with MGZon

## File Structure

```bash
passport-mgzon/
├── index.js
├── icons/
│   ├── css/
│   │   └── style.css
│   ├── fonts/
│   │   ├── icomoon.eot
│   │   ├── icomoon.svg
│   │   ├── icomoon.ttf
│   │   ├── icomoon.woff
│   ├── svgs/
│   │   ├── mgzon.svg
│   │   ├── markai.svg
│   ├── demo.html
│   └── selection.json

## Development

**To test locally:**

```bash
npm install
npm test

Keywords

passport

FAQs

Package last updated on 16 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts