Skip to content

Commit 85912c0

Browse files
authored
Merge pull request #69 from dblock/custom-oauth-tokens
Documented obtaining access_token, closes #66. [ci skip]
2 parents 8d599bc + 2d6c541 commit 85912c0

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2016 Daniel Doubrovkine
3+
Copyright (c) 2015-2017 Daniel Doubrovkine & Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,28 @@ SlackRubyBotServer.configure do |config|
152152
end
153153
```
154154

155+
### Access Tokens
156+
157+
By default the implementation of [Team](lib/slack-ruby-bot-server/models/team) stores a `bot_access_token` that grants a certain amount of privileges to the bot user as described in [Slack OAuth Docs](https://api.slack.com/docs/oauth). You may not want a bot user at all, or may require different auth scopes, such as `users.profile:read` to access user profile information via `Slack::Web::Client#users_profile_get`. To obtain the non-bot access token make the following changes.
158+
159+
1) Configure your app to require additional scopes in Slack API under _OAuth_, _Permissions_
160+
2) Add `access_token` and, optionally, `scope` to your `Team` model
161+
3) Change the _Add to Slack_ buttons to require the additional scope, eg. `https://slack.com/oauth/authorize?scope=bot,users.profile:read&client_id=...`
162+
4) Store the access token returned from `Slack::Web::Client#oauth_access` and scope when creating a team in your `Teams` API endpoint.
163+
164+
You can see a sample implementation in [slack-sup#3a497b](https://github.com/dblock/slack-sup/commit/3a497b436d25d3a7738562655cda64b180ae0096).
165+
155166
### Examples Using Slack Ruby Bot Server
156167

157168
* [slack-amber-alert](https://github.com/dblock/slack-amber-alert), free service at [missingkidsbot.org](https://www.missingkidsbot.org)
169+
* [slack-sup](https://github.com/dblock/slack-sup), free service at [sup.playplay.io](https://sup.playplay.io)
158170
* [slack-gamebot](https://github.com/dblock/slack-gamebot), free service at [www.playplay.io](https://www.playplay.io)
159171
* [slack-market](https://github.com/dblock/slack-market), free service at [market.playplay.io](https://market.playplay.io)
160-
* [slack-shallbot](https://github.com/slack-ruby/slack-shellbot), free service at [shell.playplay.io](https://shell.playplay.io)
172+
* [slack-shellbot](https://github.com/slack-ruby/slack-shellbot), free service at [shell.playplay.io](https://shell.playplay.io)
161173
* [slack-api-explorer](https://github.com/slack-ruby/slack-api-explorer), free service at [api-explorer.playplay.io](https://shell.playplay.io)
162174

163175
### Copyright & License
164176

165-
Copyright [Daniel Doubrovkine](http://code.dblock.org), 2015-2016
177+
Copyright [Daniel Doubrovkine](http://code.dblock.org) and Contributors, 2015-2017
166178

167179
[MIT License](LICENSE)

0 commit comments

Comments
 (0)