Logging in programmatically from another application

  • Global Moderator Plugin & Theme Dev

    @jewa what Node version? Try Node 6 if you're on a newer version.


  • @PitaJ I am on node 6.9.2. I will uninstall that and install node 6.0.0.

    Update I have tried it still returns the same error.

  • Global Moderator Plugin & Theme Dev

    @jewa you shouldn't need to downgrade then. Any version of Node 6.x.x should work.

  • GNU/Linux Admin

    @jewa That error doesn't seem related to logging in programmatically... sounds like you have a plugin or theme installed that relies on async v1... are you on the develop branch?


  • @julian I am on nodebb version 1.4.3 not sure if that is develop branch as I am not so good with git. Yes it is not related. I just wanted to isolate the cause of my failure to log in programmatically by hosting on Heroku and trying it from there.

    I followed the steps here: https://community.nodebb.org/topic/9049/getting-nodebb-and-plugins-setup-with-heroku-and-mongodb

    and then modified web.js line 34 inside the install folder to port = process.env.PORT || port; Otherwise, it would load at port 4567 which was always failing. I think I also added process.env.PORT to line 145 in loader.js but I don't think that changed anything much. It only started nodebb when I modified web.js


  • @julian @pitaJ So I burnt the whole thing down. Cloned version 1.3.0 and re-installed. It broke down without modifying web.js so I modified it and it gave me the same error as before. What do I do?

  • GNU/Linux Admin

    Do not use Heroku as that is not a standard deployment environment for us.


  • @julian I have ditched Heroku. Deployed the app on cloud9 and it is working fine. I then try to use my plugin and I still get the same error. Here is the error on nodebb

    at OAuth2Strategy._createOAuthError (/home/ubuntu/workspace/node_modules/nodebb-plugin-sso-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/lib/strategy.js:379:17)
    at /home/ubuntu/workspace/node_modules/nodebb-plugin-sso-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/lib/strategy.js:166:45
    at /home/ubuntu/workspace/node_modules/nodebb-plugin-sso-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:191:18
    at passBackControl (/home/ubuntu/workspace/node_modules/nodebb-plugin-sso-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage.<anonymous> (/home/ubuntu/workspace/node_modules/nodebb-plugin-sso-oauth/node_modules/passport-oauth/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:921:12)
    at nextTickCallbackWith2Args (node.js:442:9)
    

    I am really frustrated I have searched the internet for help the only help I get is with respect to a possible typo or firewall. My authorization codes are being created in my database it is just at the exchange point that the failure happens.

    It is a pretty awful user experience to log into the forum after logging into my web app.

    Would definitely be using nodebb for a stand-alone forum but this is me giving up after a 4 day battle. I might as well have built a very simple forum for my website in those 4 days. Ugh!!!

  • GNU/Linux Admin

    @jewa Looks like you've cut off the error at the top there, so I can't see the issue.


  • @julian I have been struggling to replicate the error. But I would post it once I manage to replicate it.

Suggested Topics

  • 1
  • 2
  • 10
  • 5
  • 9
| |