Git Product home page Git Product logo

Comments (9)

pogilon avatar pogilon commented on September 14, 2024

@connormanning mainly I am interested in how to configure the authentication server to make it work with greyhound. Thanks!

from greyhound.

pogilon avatar pogilon commented on September 14, 2024

Hello @connormanning, I have been trying to configure an authentication server, but I don't see where or how greyhound will check for the cookie for a specific user and not a general cookie. Could you please let me know? Thanks!

from greyhound.

connormanning avatar connormanning commented on September 14, 2024

See docs here. For authentication server functionality, your project needs to store a cookie that is identifiable to the current user, e.g. a login token. Then set that user-identifiable cookie name as your configuration value for auth.cookieName to Greyhound. Then your authentication server will receive requests from Greyhound with the same cookie you're already using for auth to your application.

from greyhound.

pogilon avatar pogilon commented on September 14, 2024

@connormanning thank you. It just was not very clear to me the cookie workflow from the docs. Does Greyhound pick the login token cookie which name is specified in ("auth.cookieName") from the user and then validates it in the auth server t check for access to a resource? Thanks. I will give it a try.

from greyhound.

connormanning avatar connormanning commented on September 14, 2024

Greyhound will make requests to <your-auth-server>/<resource-requested>, and will forward the cookie with the name auth.cookieName in this request. The rest is up to your auth server - send a 200 or 4xx error with this information.

from greyhound.

pogilon avatar pogilon commented on September 14, 2024

Thank you @connormanning. I am still trying to solve it. It looks like it is always authenticating the user, even if it should not. Need to see why the authentication feature is not working. Thanks.

from greyhound.

connormanning avatar connormanning commented on September 14, 2024

I've verified against a sample auth server that just sends 200 if the resource is autzen or 400 otherwise and it's working as intended:

var app = require('express')();
app.use('/:resource', function(req, res) {
    res.status(req.params.resource == 'autzen' ? 200 : 400).send();
});
require('http').createServer(app).listen(8081);

...with Greyhound configuration:

{   "http": { "port": 8085 },
    "auth": {
        "path": "http://localhost:8081",
        "cacheMinutes": { "good": 1, "bad": 1 }
    }
}

I'd recommend building up from something trivial like this.

from greyhound.

pogilon avatar pogilon commented on September 14, 2024

thank you so much @connormanning . I am trying to run this example but I am always getting the following error from greyhound. What do you think it could be?
"""
LOG Auth proxy err: { [Error: connect ECONNREFUSED 127.0.0.1:8081]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 8081 }
03:21:18:69 LOG Error handling: { code: 500, message: 'Authentication error' }

"""

from greyhound.

pogilon avatar pogilon commented on September 14, 2024

@connormanning just so you know. The error was that I needed to map the network to the docker container too with ( sudo docker run --net="host") . So that my host and docker container 127.0.0.1:8081 were the same. Thanks for everything. I think I got it from here.

from greyhound.

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.