Automate Oauth process of receiving Slack access token for Web API
Automate Oauth process of receiving Slack access token for Web API
I am working with the Slack oAuth API.
When I do a GET on https://slack.com/oauth/authorize passing my client_id, and the scope, I get html reponse asking for workspace URL.
After that I need to sign in and provide my password before code
is returned which I can use to renew my temporary token
code
My question is: How can I automate the process of providing workspace URL, username and password? I need to get the code return after authentication (the temporary token) so that I can call https://slack.com/api/oauth.access
to renew my token
https://slack.com/api/oauth.access
My reasoning is that if I have access (from the app I created) to: App ID
, Client ID
, Client Secret
, Signing Secret
and Verification Token
there should be a way for me make simple API call to get code
or is my understanding of the slack OAuth flow wrong?
App ID
Client ID
Client Secret
Signing Secret
Verification Token
code
NB: I have taken a look at https://api.slack.com/docs/oauth but I was not able to get it done. I am also aware that I can make the /signin
and /checkcookie
to get this done but it involves parsing HTML response for parameter values needed to make subsequent calls. I just feel there a simpler way to do it.
/signin
/checkcookie
This Stackoverflow question is not a duplicate because is it mainly referred to a case of not having an app created; In my case, I have an app created.
@Erik, I am doing this in a test environment for my interfacing application. If I cannot automate the install process what would your alternative suggestions be? Thanks
– papigee
Sep 15 '18 at 19:05
Slack does not offer any special support for this approach. But if you want to automate the install process I would a web based testing tool of your choosing. Check out these references: Stackoverflow Wikipedia
– Erik Kalkoken
Sep 16 '18 at 10:40
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy
Why do you want to automate the installation / Oauth process? It has to be done only once per Slack workspace and is meant to require a physical user to login with his credentials. The access tokens your app receives as result of that process never expires and should be stored by your app for future usage.
– Erik Kalkoken
Sep 15 '18 at 18:58