How can we add more scopes/permissions for a user when he signs into slack using Sign in to Slack button. I have added the scopes in the Outh permissions/scopes on my Slack App.it works for the primary owner but not for other users. I have a similar question here. I think I figured out the that I have to add permissions but cannot figure out how. I tried adding it to the initial oauth flow of the sign in with Slack button but it says that I am not allowed to use other scopes with identity.basic.
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<a href="https://slack.com/oauth/authorize?scope=identity.basic,identity.email,identity.team,identity.avatar&client_id=373568302675.374024189699">
<img alt="Sign in with Slack" height="40" width="172" src="https://platform.slack-edge.com/img/sign_in_with_slack.png"
srcset="https://platform.slack-edge.com/img/sign_in_with_slack.png 1x, https://platform.slack-edge.com/img/sign_in_with_slack@2x.png 2x" />
</a>
</div>
</div>
Can someone tell me exactly where should I add the permissions for users who are not primary owners?
I made another button on the cshtml as follows:
<input type="button" value="Authenticate again to send Message" class="btn btn-warning" onclick="location.href = 'https://slack.com/oauth/authorize?scope=incoming-webhook,im:write,chat:write:user&client_id=373568302675.374024189699'"/>
And then on click it is leading to the same function as Sign in with Slack which is as follows:
public SlackAuthToken GetAccessToken(ProgramParameter startParam, string clientId, string clientSecret, string code)
{
using (var client = new WebClient())
{
string apiUrl = GetApiUrl(startParam);
string url = apiUrl + "/oauth.access?client_id=" + clientId + "&client_secret=" + clientSecret + "&code=" + code;
var response = client.DownloadString(url);
SlackAuthToken slackTest = JsonConvert.DeserializeObject<SlackAuthToken>(response);
string accessToken = slackTest.AccessToken;
string urlUserIdentity = "https://slack.com/api/users.identity?token=" + accessToken;
var responseUser = client.DownloadString(urlUserIdentity);
SlackAuthToken slack = JsonConvert.DeserializeObject<SlackAuthToken>(responseUser);
return slackTest;
}
}