Skip to content

Commit

Permalink
Change occurrences of Omniauth to OmniAuth.
Browse files Browse the repository at this point in the history
Change name of gem to ginjo-omniauth-slack.
Update readme.
Prep for release.
  • Loading branch information
ginjo committed Aug 28, 2018
1 parent 7040973 commit 5734d37
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## v2.4.0 (unreleased)
## v2.4.0

Initial release of ginjo-omniauth-slack

* Add/fix AuthHash `extra['scopes_requested']`. [wbr]
Expand Down
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To view the original omniauth-slack from [@kmrshntr](https://github.com/kmrshntr), go [here](https://github.com/kmrshntr/omniauth-slack).

# Omniauth::Slack
# OmniAuth::Slack

This Gem contains the Slack strategy for OmniAuth and supports most features of
the [Slack OAuth2 authorization API](https://api.slack.com/docs/oauth), including both the
Expand All @@ -21,10 +21,16 @@ Now sign into the [Slack application dashboard](https://api.slack.com/applicatio

## Using This Strategy

First start by adding this gem to your Gemfile (This will install the latest HEAD version from the ginjo repository):
First start by adding this gem to your Gemfile:

```ruby
gem 'omniauth-slack', git: 'https://github.com/ginjo/omniauth-slack'
gem 'ginjo-omniauth-slack'
```

Or specify the latest HEAD version from the ginjo repository:

```ruby
gem 'ginjo-omniauth-slack', git: 'https://github.com/ginjo/omniauth-slack'
```

Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
Expand Down Expand Up @@ -67,6 +73,18 @@ end
```


To manually install and require the gem:
```bash
# shell
gem install ginjo-omniauth-slack
````

```ruby
# ruby
require 'omniauth-slack'
```


## Scopes
Slack lets you choose from a [few different scopes](https://api.slack.com/docs/oauth-scopes#scopes).
*Here's another [table of Slack scopes](https://api.slack.com/scopes) showing classic and new app compatibility.*
Expand Down Expand Up @@ -97,7 +115,7 @@ You will need to specify at least one scope to get a successful authentication a
Some of these options can also be given at runtime in the authorization request url.
`scope`, `team`, `team_domain`, and `redirect_uri` can be given at runtime. `scope`, `team`, and `redirect_uri` will be passed directly through to Slack in the OAuth GET request.
`scope`, `team`, `team_domain`, and `redirect_uri` can be given at runtime. `scope`, `team`, and `redirect_uri` will be passed directly through to Slack in the OAuth GET request:
```ruby
https://slack.com/oauth/authorize?scope=identity.basic,identity.email&team=team-id&redirect_uri=https://different.subdomain/different/callback/path
Expand Down Expand Up @@ -143,7 +161,7 @@ Another (possibly undocumented) way to specify team is by passing in the `:team_
In contrast to setting `:team`, setting `:team_domain` will force authentication against the specified team (credentials permitting of course), even if the user is not signed in to that team.
However, if you are already signed in to that team, specifying the `:team_domain` alone will not let you skip the Slack authorization dialog, as is possible when you specify `:team`.
Sign in behavior with team settings and signed in state can be confusing. Here is a breakdown based on Slack documentation and observations while using this gem:
Sign in behavior with team settings and signed in state can be confusing. Here is a breakdown based on Slack documentation and observations while using this gem.
#### Team settings and sign in state vs Slack OAuth behavior.
Expand Down Expand Up @@ -219,7 +237,8 @@ If set, only a single api request will be made for each authorization. The respo
Specify which API calls to include or exclude after the initial authorization call.
This will affect what data you see in the AuthHash object. These two options are mutually exclusive. Use one or the other but not both. If neither option is declared, all API calls will be made (depending on scope and permissions).
The currently available calls are
The currently available calls are:
* identity
* user_info
* user_profile
Expand Down Expand Up @@ -262,8 +281,6 @@ provider :slack, key, secret,
}
```
*The exact syntax and behavior of this feature is not settled yet, but the above examples should work (assuming you have the correct scopes).*

## Workspace Apps and Tokens
This gem provides support for Slack's developer preview of [Workspace apps](https://api.slack.com/workspace-apps-preview). There are some important differences between Slack's classic apps and the new Workspace apps. The main points to be aware of when using omniauth-slack with Workspace Apps are:
Expand Down
4 changes: 2 additions & 2 deletions lib/omniauth-slack/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Omniauth
module OmniAuth
module Slack
VERSION = "2.4.0.pre04"
VERSION = "2.4.0"
end
end
2 changes: 1 addition & 1 deletion omniauth-slack.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require File.expand_path('../lib/omniauth-slack/version', __FILE__)

Gem::Specification.new do |spec|
spec.name = 'ginjo-omniauth-slack'
spec.version = Omniauth::Slack::VERSION
spec.version = OmniAuth::Slack::VERSION
spec.authors = ['kimura', 'ginjo']
spec.email = ['[email protected]', '[email protected]']
spec.description = %q{OmniAuth strategy for Slack}
Expand Down

0 comments on commit 5734d37

Please sign in to comment.