|  | @@ -5,8 +5,7 @@ A tiny web application to invite a user into your Slack team.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  Inspired by
 | 
	
		
			
				|  |  |  [How I hacked Slack into a community platform with Typeform](https://levels.io/slack-typeform-auto-invite-sign-ups/)
 | 
	
		
			
				|  |  | -and
 | 
	
		
			
				|  |  | -Socket.io's Slack page.
 | 
	
		
			
				|  |  | +and Socket.io's Slack page.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  This project supports Heroku, Azure and Cloud Foundry.
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -23,10 +22,7 @@ Fill out `config.js` as your infomation.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  * `community`: your community or team name to display on join page.
 | 
	
		
			
				|  |  |  * `slackUrl` : your slack team url (ex.: socketio.slack.com)
 | 
	
		
			
				|  |  | -* `slacktoken` : Your access token for Slack.
 | 
	
		
			
				|  |  | -  - You can generate it in <https://api.slack.com/custom-integrations/legacy-tokens>.
 | 
	
		
			
				|  |  | -  - **You should generate the token in admin user, not owner.**
 | 
	
		
			
				|  |  | -  If you generate the token in owner user, a `missing_scope` error may occur.
 | 
	
		
			
				|  |  | +* `slacktoken` : Your access token for Slack. (see [Issue token](#issue-token))
 | 
	
		
			
				|  |  |  * `inviteToken`: An optional security measure - if it is set, then that token will be required to get invited.
 | 
	
		
			
				|  |  |  * `locale`: Application language (currently `cs`, `de`, `en`, `es`, `fr`, `it`,  `ja`, `ko`, `pl`, `pt`, `pt-BR`, `tr`, `zh-CN` and `zh-TW` available).
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -37,10 +33,7 @@ If you want to use a `.env` file, create a file in the root called `.env` with t
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  - `COMMUNITY_NAME` : Your community or team name to display on join page.
 | 
	
		
			
				|  |  |  - `SLACK_URL` : Your Slack team url (ex.: socketio.slack.com)
 | 
	
		
			
				|  |  | -- `SLACK_TOKEN` : Your access token for Slack.
 | 
	
		
			
				|  |  | -  - You can generate it in <https://api.slack.com/web#auth>.
 | 
	
		
			
				|  |  | -  - **You should generate the token as an admin user, not owner.**
 | 
	
		
			
				|  |  | -  If you generate the token in owner user, a `missing_scope` error may occur.
 | 
	
		
			
				|  |  | +- `SLACK_TOKEN` : Your access token for Slack. (see [Issue token](#issue-token))
 | 
	
		
			
				|  |  |  - `INVITE_TOKEN`: An optional security measure - if it is set, then that token will be required to get invited.
 | 
	
		
			
				|  |  |  - `LOCALE`: Application language (currently `cs`, `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `pl`, `pt`, `pt-BR`, `tr`, `zh-CN` and `zh-TW` available).
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -90,3 +83,36 @@ $ cd slack-invite-automation
 | 
	
		
			
				|  |  |  $ docker build -t slack-invite-automation .
 | 
	
		
			
				|  |  |  $ docker run -it --rm -e COMMUNITY_NAME="YOUR-TEAM-NAME" -e SLACK_URL="YOUR-TEAM.slack.com" -e SLACK_TOKEN="YOUR-ACCESS-TOKEN" -p 3000:3000 slack-invite-automation
 | 
	
		
			
				|  |  |  ```
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +## Issue token
 | 
	
		
			
				|  |  | +**You should generate the token in admin user, not owner.** If you generate the token in owner user, a `missing_scope` error may occur.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +There are two ways to issue the access token.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +### Legacy tokens
 | 
	
		
			
				|  |  | +1. Visit <https://api.slack.com/custom-integrations/legacy-tokens>.
 | 
	
		
			
				|  |  | +1. Click `Create token`.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +### OAuth tokens
 | 
	
		
			
				|  |  | +1. Visit <https://api.slack.com/apps> and Create New App.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +1. Click "Permissions".
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +1. In "OAuth & Permissions" page, select `admin` scope under "Permission Scopes" menu and save changes.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +1. Click "Install App to Team".
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +1. Visit <https://slack.com/oauth/authorize?&client_id=CLIENT_ID&team=TEAM_ID&install_redirect=install-on-team&scope=admin+client> in your browser and authorize it.
 | 
	
		
			
				|  |  | +    * It authorizes the `client` permission. Otherwise, you can see `{"ok":false,"error":"missing_scope","needed":"client","provided":"admin"}` error.
 | 
	
		
			
				|  |  | +    * Your `CLIENT_ID` could be found in "Basic Information" menu of your app page that you just install.
 | 
	
		
			
				|  |  | +    * Your `TEAM_ID` could be found in <https://api.slack.com/methods/team.info/test>
 |