Giter VIP home page Giter VIP logo

nodebb-plugin-ns-login's Introduction

NodeBB: Simple Login

Simple API endpoint for external login. Special use case: external login check if user's credentials are valid.

Version

API

Plugin adds additional API endpoint.

[POST] https://YourBoardDomain.com/api/ns/login

Properties:

  • username [String] - Required field. It could be username or email. It uses internal NodeBB methods to resolve.
  • password [String] - Required field.

Result:

Successful login returns user data, it looks like:

{
"_key": "user:1",
"username": "Nicolas",
"userslug": "nicolas",
"email": "[email protected]",
"email:confirmed": 1,
"joindate": 1432379229517,
"picture": "https://secure.gravatar.com/avatar/16e774e25b68ab1d41d2cc269a29983a?size=128&default=identicon&rating=pg",
"gravatarpicture": "https://secure.gravatar.com/avatar/16e774e25b68ab1d41d2cc269a29983a?size=128&default=identicon&rating=pg",
"fullname": "",
"location": "",
"birthday": "",
"website": "",
"signature": "",
"uploadedpicture": "",
"profileviews": 0,
"reputation": 0,
"postcount": 0,
"topiccount": 0,
"lastposttime": 0,
"banned": 0,
"status": "online",
"uid": 1,
"passwordExpiry": 0,
"lastonline": 1432379559871
}

Using plugin as internal REST API

Whenever used as internal API disable IP limiter in userDefence instance of express-brute.

userDefence.getMiddleware({
    // Disregard IP address when matching requests if set to true
    // Set true if API is used internaly from few IPs
    ignoreIP: true, 
    key: function (req, res, next) {
        // prevent too many attempts for the same username
        next(req.body.username);
    }
})

Additional information

  • It is simple
  • It has brute-force defence. The brute-force counter resets on successful login.

nodebb-plugin-ns-login's People

Contributors

ilblog avatar mdorda avatar nicolassiver avatar roiexlab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nodebb-plugin-ns-login's Issues

Return email validity

Hi, I think your plugin could use a small improvement...
When logged in correctly, the returned JSON should also return wether or not the email was validated - In order to check if the user is just a troll...
Thanks in advance!

Not working with 1.13.1

i guess the routing is not working the same way as before in 1.13.1.
When calling the api route it says not found.

Can't Access the API

I've installed this on the latest NodeBB and I can't access the API from domain.com/api/ns/login -> I get a 404 not found.. Any ideas?

NodeBB v1.11.x compatibility

When trying to run the plugin with NodeBB v1.11.1 it throws the error:

Error: Cannot find module './src/emitter'

no sessions

I am using nodebb for the community section in another app.

I want user to be logged in when he logs into my app. I simultaneously log in using ns-login but if I visit the forum address on the same browser, the user is not logged in.

I checked the res.body and status is offline even after signing me in. How do I resolve this issue?

Cannot access with POSTMAN

im trying to check if works, i am using POSTMAN and i have no result, is it a Json Object right?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.