0

I'm writing the frontend to an application that receives live-data from a Solace Message Broker. At the moment, both the frontend and the message broker are running in a protected dev environment.

At some point we obviously want to make the application openly available. We have working authentication in the application, but we want the message broker to validate the token sent from the frontend before building a connection and later on subscriptions.

Authentication is done with the angular-auth-oidc-client. However, the solace documentation about Configuring OAuth Authorization states that

Solace PubSub+ event brokers support OAuth authorization only for MQTT clients.

The app uses the solcientjs npm package to communicate with the broker. I have to admit I am not very firm with all the message protocols that are there, but I think the package does not use an MQTT connection.

That leaves Kerberos from the list of available client authentication types. Looking at the kerberos authorization documentation however, it also says

Kerberos authentication is not available for Solace Web messaging APIs

So now I am left wondering how I could validate a token coming in from a client. Here is how an "ideal" flow would look for me:

  1. User authenticates, app receives bearer token
  2. App calls session.connect() to build up a connection with the broker, sends the bearer token along
  3. In the preConnect hook (if it were to exist) I could send a request to the STS that issued the token and wait for a response
  4. If the STS confirms that the token is valid, the message brokers confirms the connection and allows subscriptions. Otherwise it denies the connection.

Is there a way to achieve this? Am I maybe horribly misunderstanding something? I do not have much experience with Solace and work only on the frontend, not the part that manages the broker.

Grateful for any hints.

Spray'n'Pray
  • 190
  • 1
  • 15

1 Answers1

1

Currently, only MQTT clients can authenticate using OAuth. With solclientjs, the authentication options are to use an internal database, LDAP, RADIUS, or client certificate authentication.

Until OAuth is available for all SMF clients, you could use a third-party MQTT client library for connecting to Solace and authenticating using OAuth tokens.

Alexandra Masse
  • 1,277
  • 1
  • 7
  • 11