why deepstreamHub? compare us getting started feature roadmap faq
use cases pricing
products
developers
company
blog contact

Everytime a client SDK connects to deepstreamHub it needs to authenticate. The client establishes an encrypted connection as soon as ds = deepstream( 'wss://app-url' ); is called, however this connection stays in a sort of quarantine state until it is authenticated using ds.login().

deepstreamHub supports a number of different authentication strategies. These can be combined and need to be enabled and configured individually via the dashboard or HTTP API.

Authentication Dashboard

Authentication type open

By default, all connections to deepstreamHub are allowed. Clients can login by simply invoking deepstream( 'wss://app-url' ).login() without providing any parameters. We call this open authentication, you can learn more about it here.

Info

  • The same application can support both public access via open authentication and other auth-types with elevated rights. You can use Valve Permissions to distuingish between them. If your app requires all users to authenticate, make sure to turn open auth off!

Authentication type email

Email authentication allows you to manage users identified by their email address and password via the dashboard or HTTP API. You can add users in the dashboard's 'user' section. You can learn more about email auth here.

Email auth requires two parameters for login:

email: 'alex@test.com',
password: '.......'

e.g.

client.login({
    email: 'alex@test.com',
    password: '.......'
}, (success, data) => {
    console.log(success, data) // true { favouriteColour: 'blue', id: '${uuid}' }
});

Authentication type webhook

Webhooks are deepstreamHub's most flexible authentication method. They allow you to specify any kind of login data that will be forwarded along with cookies and other connection parameters to an HTTP endpoint of your choosing. Users are granted access based on your server's reply. You can learn more about HTTP Auth here.

Webhook auth just requires a type of 'webhook', every other data is up to you, e.g.

client.login({
    type: 'webhook',
    myCustomAuthParam: '...'
}, (success, data) => {
    //...
});