Skip to content
  • 2 Votes
    4 Posts
    324 Views
    julianJ

    Lastly, keep in mind that sso-oauth is not deprecated, and will still be maintained. It's still a reference implementation for OAuth2 providers that follow the standard loosely. Also it happens to be the only OAuth 1 reference implementation.

  • 0 Votes
    1 Posts
    265 Views
    K

    Hi all,

    still continuing on my OAuth2 plugin implementation, I've a problem I can't actually solve and need you valuable advises.

    I've this fragment in my plugin

    OAuth.getStrategy = function (strategies, callback) { winston.verbose('[maxonID] --> OAuth.getStrategy'); if (configOk) { passportOAuth = require('passport-oauth2'); passportOAuth.Strategy.prototype.userProfile = function (accessToken, done) { if (!accessToken) { done(new Error('Missing token, cannot call the userinfo endpoint without it.')); } this._oauth2.useAuthorizationHeaderforGET(true); this._oauth2.get(constants.userRoute, accessToken, function (err, body, res) { if (err) { console.error(err); return done(new Error('Failed to get user info. Exception was previously logged.')); } if (res.statusCode < 200 || res.statusCode > 299) { return done(new Error('Unexpected response from userInfo. [' + res.statusCode + '] [' + body + ']')); } OAuth.validateEntitlement(accessToken, constants.allowedEntitlement, function (err, accessAllowed) { if (err) { return done(err); } if (!accessAllowed) { // Need to find a way to gracefully notify the user and point back to login page return done(new Error('Forum access is not granted. Please contact your representative.')); } try { var json = JSON.parse(body); OAuth.parseUserReturn(json, function (err, profile) { ...

    and I'd like to return the user to the forum login page and notify him about the issue, something like when the password is wrong. Is there a smart way to make it happen from such a plugin without rising an error?

    Thanks a lot for your valuable insights, R.

  • 0 Votes
    12 Posts
    1k Views
    K

    Thanks a lot everybody for the contributions to this discussion!

    Your recommendations were all useful to better understanding the plugin and finally realise a prototype against 10Duke.

    Cheers, R

  • 1 Votes
    9 Posts
    3k Views
    Nethrah AyyaswamiN

    @khalid-kunji did u get this working? I am getting the same error.

  • 0 Votes
    1 Posts
    1k Views
    remydevR

    Hello,

    I'm working on a SSO integration from a django SSO.
    In my django project i add 'oauth2_provider'

    Welcome to Django OAuth Toolkit Documentation — Django OAuth Toolkit 2.3.0 documentation

    favicon

    (django-oauth-toolkit.readthedocs.io)

    And i get this :

    0_1512387850634_ad046269-f481-410a-bc24-2ca89b39f6dd-image.png

    On the nodebb side, I started from the plugin
    https://github.com/julianlam/nodebb-plugin-sso-oauth

    Which I modified as a result:

    The config.json file

    "oauth": { "id": "rs2yEx7aqrj7ZIgVRC9IFL7p0DyIjQwWPST4BqVW", "secret": "6A678EDFqAYtl0sALS5rqk2mfhlBQi0HIgoGH5mPaeIpnZGni8BdOFiv" },

    and in the library.js) i change this lignes

    var constants = Object.freeze({ type: 'oauth2', // Either 'oauth' or 'oauth2' name: 'nodebb_django', // Something unique to your OAuth provider in lowercase, like "github", or "nodebb" oauth: { requestTokenURL: '', accessTokenURL: '', userAuthorizationURL: '', consumerKey: nconf.get('oauth:key'), // don't change this line consumerSecret: nconf.get('oauth:secret'), // don't change this line }, oauth2: { authorizationURL: 'https://beta.esprit-bourse.com/oauth/authorize', tokenURL: 'https://beta.esprit-bourse.com/oauth/token', clientID: nconf.get('oauth:id'), // don't change this line clientSecret: nconf.get('oauth:secret'), // don't change this line }, userRoute: '' // This is the address to your app's "user profile" API endpoint (expects JSON) }),

    I've never programmed in JS nodes, so I don't really know what to do, and I don't understand all the code.

    I may have to change the information as indicated. Update profile information (around line 137 of library. js). But there is no user account to use the Oauth system

    After a git clone, i can't enable the plugin so i think there is something else to change.

    if someone can help me I will document everything for the link Oauth django/nodeBB. Otherwise, I'll keep the site and forum separate.

  • Facebook Oauth

    Solved Technical Support
    4
    0 Votes
    4 Posts
    2k Views
    julianJ

    Could be 😃 Glad to hear it is working now.

  • 0 Votes
    3 Posts
    2k Views
    A

    Is there any progress on this, as I am also interested in using Drupal with NodeBB.

  • 0 Votes
    2 Posts
    3k Views
    Sameer YadavS

    My bad, this error was caused by extra / in config.json

  • 0 Votes
    1 Posts
    1k Views
    J

    I've been looking around off and on all day. But is anyone aware of an OAuth Service Provider? For example, for our site we are looking to implement OAuth across all of our applications for Single Sign On. We are hoping to outsource it to alleviate some of our development and free us up to work on other things.

    Thanks!

  • 3 Votes
    2 Posts
    2k Views
    julianJ

    Yay, another entry into the contest 😄

  • 0 Votes
    7 Posts
    3k Views
    julianJ

    Aw, David Tennant! I just finished watching The Fall of Pompeii

  • 1 Votes
    4 Posts
    3k Views
    phenomlabP

    @mootzville Hi. Is it possible to update this plugin to work with 1.17 ?

  • NodeBB OAuth SSO

    General Discussion
    15
    0 Votes
    15 Posts
    10k Views
    kbladeK

    @macbroadcast I am also getting the same error. Did you get a fix for that?

  • 0 Votes
    23 Posts
    21k Views
    Mohit AgrawalM

    Try https://github.com/beingmohit/NodeBB-Wordpress-Auth