mercredi 18 décembre 2019

Ubuntu Server configuration authentication issue. (without SSL attached)

I am coming across an issue in Ubuntu server configuration.The server is running but not able to authenticate the user.I am using laravel 5.8 and auth session is in database session table. The error is as following:

`[5:41:27 AM] - Preparing authentication request to: http://localhost:6001/laravel_app/public
[5:41:27 AM] - Sending auth request to: http://localhost:6001/laravel_app/public/broadcasting/auth

⚠ [5:41:27 AM] - tuwKsGTb6P9Qxdb2AAAA could not be authenticated to private-App.User.6854
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /laravel_app/public/broadcasting/auth</pre>
</body>
</html>

Client can not be authenticated, got HTTP status 404
[5:42:10 AM] - Preparing authentication request to: http://localhost:6001/laravel_app/public
[5:42:10 AM] - Sending auth request to: http://localhost:6001/laravel_app/public/broadcasting/auth

[5:42:10 AM] - 7hHWOd5R9Xq0xr2CAAAB could not be authenticated to private-App.User.xyz
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /laravel_app/public/broadcasting/auth</pre>
</body>
</html>

Client can not be authenticated, got HTTP status 404`

laravel-echo-server.js

{
    "authHost": "http://localhost:6001/laravel_app/public",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "0c611466e43adf14",
            "key": "c5f392fc02bb6b5b7898ccc0b2523829"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {},
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "secureOptions": 67108864,
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "subscribers": {
        "http": true,
        "redis": true
    },
"apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "*",
        "allowMethods": "GET",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

With out ssl apache2 configuration file is

<VirtualHost *:80>
ServerName xyz.abc.domain.com


ProxyPreserveHost On
ProxyPass /socket.io http://localhost:6001/socket.io
ProxyPassReverse /socket.io http://localhost:6001/socket.io


</VirtualHost>

Echo Configuration Bootstrape.js

window.Echo = new Echo({
    broadcaster: "socket.io",
    host: "http://xyz.abc.domain.com" 
     //host: window.location.hostname 
     //host: window.location.hostname + ":6001"
});

Let us know if you need any further details.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire