Giter VIP home page Giter VIP logo

Comments (6)

lloydbenson avatar lloydbenson commented on May 31, 2024

I am not a bell expert by any means but the documentation in the README says:

cookie - the name of the cookie used to manage the temporary state. Defaults to 'bell-provider' where 'provider' is the provider name (or 'custom' for custom providers). For example, the Twitter cookie name defaults to 'bell-twitter'.

So I think what you want is to override the default cookie name in at least one place. I think State likely refers to the cookie state.

from bell.

lloydbenson avatar lloydbenson commented on May 31, 2024

Haven't heard back so I will assume that is all it was.

from bell.

chmanie avatar chmanie commented on May 31, 2024

Haven't tried yet, but seems reasonable! Thank you!

from bell.

deepakshrma avatar deepakshrma commented on May 31, 2024

👍 @chmanie

from bell.

deepakshrma avatar deepakshrma commented on May 31, 2024

Install forked hapi. I have just commented state is already defined line. Just work around.

 "dependencies": {
    "hapi": "git+https://github.com/deepakshrma/hapi.git",
      }
npm i git+https://github.com/deepakshrma/hapi.git

Working Example:

server.register(Bell, function (err) {

    server.auth.strategy('facebook', 'bell', {
        provider: 'facebook',
        password: 'password',
        isSecure: false,
        clientId: 'xxxxx',
        clientSecret: 'xxxxxx',
        location: server.info.uri
    });
    server.auth.strategy('custom', 'bell', {
        provider: "facebook",
        cookie: "bell-facebook",
        password: 'password',
        isSecure: false,
        clientId: 'xxx',
        clientSecret: 'xx',
        location: server.info.uri
    });

    server.route({
        method: '*',
        path: '/auth/callback/without',
        config: {
            auth: {
                strategy: 'facebook',
                mode: 'try'
            },
            handler: handler
        }
    });
    server.route({
        method: '*',
        path: '/auth/callback/with',
        config: {
            auth: {
                strategy: 'custom',
                mode: 'try'
            },
            handler: handler
        }
    });
    function handler(request, reply) {
        console.dir(request);
        if (!request.auth.isAuthenticated) {
            return reply('Authentication failed due to: ' + request.auth.error.message);
        }
        reply('<pre>' + JSON.stringify(request.auth.credentials, null, 4) + '</pre>');
    }

    server.start(function (err) {

        console.log('Server started at:', server.info.uri);
    });
})

from bell.

lock avatar lock commented on May 31, 2024

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

from bell.

Related Issues (20)

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.