-
Notifications
You must be signed in to change notification settings - Fork 31
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
[BUG] Calling the SCIM API via fetch in a NextGen app #254
Comments
Hey @mcsescott sorry for my late response here! First, just to clarify, and based on your code it look to me like you have done this already, but the SCIM APIs need a special admin token with admin scopes. The default token provided in Custom Functions won't have the ability to use the SCIM APIs. Given you seem to be leveraging your own token in a separate variable, look to me like you are managing this token yourself... Second, are you seeing this in local run or in deployed? |
Hi @filmaj! Yes, I am managing the admin token myself. Since there are no native functions for SCIM (and admin APIs) I am managing these in code for a NextGen app. I have other admin (and Discovery) APIs working, but I believe the URL format of SCIM is what the hangup is here. I am testing locally prior to deploying to "run on Slack." We may have to continue to run locally as well, so we have internal access to our environment/servers, without bypassing firewalls and proxies to query internal systems from Slack. |
I can definitely reproduce this when running locally 😬 I believe it is because the 'deno runtime' portion of this SDK (the deno-slack-runtime project) only pre-approves the 'slack.com' domain when running locally. It looks to me like slack.com and api.slack.com are treated as separate domains by deno (which is reasonable). And indeed, adding api.slack.com as a domain raises the error you experienced. I have a work-in-progress branch up as a draft PR, which fixes this issue in my local testing (you can track dev here: slackapi/deno-slack-runtime#60). You can take advantage of this pre-release patch, in your app, when running locally via
That should unblock you for local run in the short term, at least. |
I also took a quick look at our backend code and I think deployed apps will suffer from the same issue, unfortunately. I will get this on that team's radar so that we can get to work patching it. |
Update: as for deployed apps, they seem to already pre-approve api.slack.com, just tested it out. |
I have tested this successfully using your option 1 above. Thanks for the great support, @filmaj ! |
deno-slack-hooks v1.2.3 is now live and should fix this issue. It also lets you remove this workaround from your app @mcsescott. In particular, you should be able to update the
Just pointing the I will close this down, but if you have further problems, feel free to re-open/comment/at-mention me/open a new issue and we will be happy to help. |
Yep... I've already removed the Thank you again! |
I'm creating a NextGen app and need to query a user's IDP groups. The only way to do this is via a call to the SCIM API. So, I am using a fetch method inside my code.
When trying to save the file, I get the following error:
So, I head over to my manifest file to add slack.com or api.slack.com, and of course I get the following error:
I am able to make other successful calls to Slack's API using the fetch method (http://slack.com/api/xxxxxxxx), but the SCIM API is giving me fits.
Any ideas?
Thanks in advance...
The text was updated successfully, but these errors were encountered: