Skip to content

Instantly share code, notes, and snippets.

@kanapuli
Created October 26, 2017 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanapuli/e2f5d9648c8dc148b0f7ed06eaa3901f to your computer and use it in GitHub Desktop.
Save kanapuli/e2f5d9648c8dc148b0f7ed06eaa3901f to your computer and use it in GitHub Desktop.
package authentication
//SlackAuth responses back the Login URL
func (LoginService) SlackAuth(ctx context.Context) (redirectURL string, err error) {
conf := &oauth2.Config{
ClientID: slackClientID,
ClientSecret: slackClientSecret,
Scopes: slackScopes,
Endpoint: oauth2.Endpoint{
AuthURL: slackAuthURL,
TokenURL: slackTokenURL,
},
}
url := conf.AuthCodeURL("state", oauth2.AccessTypeOffline)
//fmt.Println("Visit the url to get access token of slack : ", url)
return string(url), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment