Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error during subscribe received #94

Closed
snaquaye opened this issue Mar 19, 2018 · 6 comments
Closed

error during subscribe received #94

snaquaye opened this issue Mar 19, 2018 · 6 comments

Comments

@snaquaye
Copy link

Hello,
I've been struggling with this, since morning. When I try subscribing to a channel, using a channel key, generated from the keygen, it displaying the following in the logs

2018/03/19 15:27:44 [conn] created (8491AD30)
2018/03/19 15:27:45 [conn] created (8591AD30)
2018/03/19 15:27:45 [conn] error during subscribe received (The security key provided is not authorized to perform this operation.)

Can anyone help me out?
Thanks

@Florimond
Copy link
Member

Could you post how you generate the key, and how do you subscribe?

@snaquaye
Copy link
Author

I generate the key from myipaddress:8080/keygen and use the following code for subscription

const subscriptionList = [
  `${process.env.EMITTER_CHANNEL}/oauth-server/user_registered`
];

const client = emitter.connect({
    host: process.env.EMITTER_HOST,
    port: process.env.EMITTER_PORT
  }, () => {
    console.log('connected');
  });

  client.on('connect', () => {
    const uniqueSubscriptionList = new Set(subscriptionList);

    if (uniqueSubscriptionList.size) {
      uniqueSubscriptionList.forEach((subscriptionItem, index, array) => {
        client.subscribe({
          channel: subscriptionItem,
          key: process.env.EMITTER_KEY
        });
      });
    }
  });

@snaquaye
Copy link
Author

I would also want to add, using the same code and a local installation of emitter, on my development machine, the client was able to subscribe to emitter seamlessly.

@Florimond
Copy link
Member

I generate the key from myipaddress:8080/keygen

I would also want to add, using the same code and a local installation of emitter, on my development machine, the client was able to subscribe to emitter seamlessly.

If you generate a key locally (myipaddress:8080/keygen), this key will only be valid for your license, on your servers.

Other than that, you may want to check the documentation here at the bottom of the page : https://emitter.io/develop/message-filtering/

@snaquaye
Copy link
Author

I'm currently using the key generated by the server on the server and not mismatching them.

Thanks

@r6m
Copy link

r6m commented May 8, 2018

Hi @kelindar
I have the same issue.
I run docker then it gives me the license and secret key. I set license as EMITTER_LICENSE env .
I'm using emitter-go provided example with o.AddBroker("tcp://127.0.0.1:8080").

I replaced the key in main.go with the secret key emitter docker gave at first run

but it returns an error:
error during publish received (The security key provided is not authorized to perform this operation.

BTW, without AddBrocker and using the cloud. it does not connect at all.
this is the connection error to the cloud emitter.
Error on Client.Connect(): Network Error : dial tcp 35.192.143.180:8080: i/o timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants