# passport-zalo

> Zalo authentication strategy for Passport require zalo-sdk.

Latest version **1.0.3** (published 2019-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install passport-zalo
pnpm add passport-zalo
yarn add passport-zalo
bun add passport-zalo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-01-08 |
| First published | 2019-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Long ACTVN |
| Maintainers | longld.ktmm |
| Keywords | passport-zalo, zalo, Zalo, passport, nodejs, zalo-sdk |

## Links

- npm: https://www.npmjs.com/package/passport-zalo
- Repository: https://github.com/longldktmm/passport-zalo
- Homepage: https://github.com/longldktmm/passport-zalo#readme
- Issues: https://github.com/longldktmm/passport-zalo/issues
- npm.io page: https://npm.io/package/passport-zalo

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-01-08
- 1.0.2 — 2019-01-08
- 1.0.1 — 2019-01-08
- 1.0.0 — 2019-01-08

## README

"# passport-zalo"
Zalo:
	https://zalo.me/
	https://en.wikipedia.org/wiki/VNG_Corporation#Zalo 
Idea passport: 
	https://github.com/didinj/node-facebook-twitter-google-github-login
Require zalo-sdk build from https://developers.zalo.me/docs/api/social-api-4
	https://github.com/zaloplatform/zalo-nodejs-sdk
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------	
How to use passport-zalo:
In passport.js, we will set up config:
---------------------------------------------------------------------------------
var ZaloStrategy = require('passport-zalo').Strategy;
passport.use(new ZaloStrategy({
    clientID: "clientID",
    clientSecret: "clientSecret",
    callbackURL: "https://domain.com/api/account/login-by-zalo",
},function (accessToken, refreshToken, profile, done) {
    	return done(profile);
    }
));
---------------------------------------------------------------------------------
In controller:

'get /api/account/login-by-zalo': 'Controller.LoginByZalo',
LoginByZalo: function (req, res) {
        passport.authenticate('zalo', function (err, data) {
            if (err || !data) {
                return res.failed("ERR01",err,data);
            } else {
                return res.success(data);
            }
        })(req, res);
    },
---------------------------------------------------------------------------------
Success:   
    gender, name(fullname), picture.data.url, birthday,id
---------------------------------------------------------------------------------
Error:
	throw or zalo oathor error
---------------------------------------------------------------------------------

---
_Source: https://npm.io/package/passport-zalo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
