From sgcWebSockets 4.4.6, the Google Cloud PubSub client components adds a new authentication protocol. Till now, only OAuth2 protocol was supported, now Authenticate using JWT is supported too. This means that you can run a service or an automated application with the need to authenticate using a Web-Browser like with OAuth2.
There is a new property called Authorization, where you can set which is the authorization scheme
- gcaOAuth2: OAuth2 protocol.
- gcaJWT: JWT authorization tokens, used for service Accounts.
*JWT support requires sgcWebSockets Enterprise Edition or latest Indy version.
Configuration
First, you must create a new Service Account from your Google Cloud Console. You can check the following article which shows how create a new service account.
Once created, you can use the method LoadSettingsFromFile to load the JSON configuration file in the sgcWebSockets PubSub client.
You can download a sample project which shows the main features of PubSub sample downloading from the following URL