Botkit-slack keep getting "Oops! Something went awry during your login"


#1

Hi, I’m following the guide for the Botkit Starter Kit, have got to the end and added the relevant Slack app credentials in the .env file but when I try to authorize it I get an " Oops! Something went awry during your login." message.

I am copy-pasting the Client ID and Secret into the bottom of the .env file by clicking the “Remix to edit” button. I’m then clicking on the button with the sunglasses where it says “Show Live” where it loads a new page with “I am a bot.” written at the top and an “Add to Slack” button underneath. When I click that I get a new page to “Authorise” or “Cancel” the bot user, and when I click to authorise, I get that message.

There is also a link under the error message to “Login again”, if I click that I get an error message OAuth Error: Invalid client_id parameter


#2

Hi @jayrdi, welcome to the Glitch Forums!

I’m sorry you’re running into trouble. Since this sounds like a problem with the configuration of your project rather than a problem with Glitch itself, I’m moving this to the Coding Help category, where it might be seen by other folks who can help as well.

For folks to be able to help specifically it will be helpful for you to share your project name, if you can. Folks who view it won’t be able to see your secrets unless you invite them to the project (read more here).

Otherwise, you could also post the contents of your .env file here (just replace the actual secrets with “***”; it’s the layout of the file that might matter, not the contents of the secrets).

And just to confirm, you’re remixing https://glitch.com/~botkit-slack?


#3

Ah, okay, thanks. Yes, it’s https://glitch.com/~botkit-slack

The project name is cloud-action


#4

Ok, great. I haven’t had a chance to look closely, but two quick things I would try:

  1. remove the first instances of clientId and clientSecret from the .env file. They shouldn’t interfere, but it never hurts to be safe
  2. put quotes around the values for clientId and clientSecret if they contain non-alphanumeric characters.

If neither of those things work I’m always a big fan of quadruple-checking that the values I used are correct; I expect you already did that, but again it never hurts to check. The error message you’re receiving is pretty explicit, and a quick glance at the code seems to indicate that it’s correctly accessing those .env values.


#5

Ah, good idea about the quotes! I’ll try that now…


#6

Ah no, it didn’t work. Thought that might be it! I checked the values and they are definitely correct. I even deleted and made a new app in Slack to start from scratch but still no luck.

I did just notice something. Before I was going to going to “Edit Project” and then when I clicked the “Show Live” button it opened in a new page (as per the 1st post), but if I do it in the window where you get the option to display “Code/App/Both”, if I do the same thing in there then as soon as I click “Add to Slack” I get a “Requests to the server have been blocked by an extension.” error.

I am running this in Chrome and have disabled all extensions and tried again, but I get the same thing…


#7

Okay, when I click “Add to Slack” in Chrome in the console I get: Refused to frame 'https://slack.com/' because it violates the following Content Security Policy directive: "frame-src 'self' https://*.glitch.me https://*.glitch.staging.me https://*.glitch.development https://accounts.google.com https://content-firebase.googleapis.com/ blob: data:".

In Firefox I get: Content Security Policy: The page's settings blocked the loading of a resource at https://slack.com/oauth/authorize?client_id=470537424226.557448602694&scope=bot&state=botkit ("frame-src").


#8

That’s because on the “tilde” page (https://glitch.com/~cloud-action) the project is showing in an iframe, so we have a restrictive cross-origin policy in place for security reasons.