Name: turing_auth
Owner: Turing School of Software & Design
Description: Github-based authentication for turing platform apps
Created: 2015-04-09 19:20:54.0
Updated: 2016-01-27 16:12:54.0
Pushed: 2016-01-27 16:12:53.0
Homepage: null
Size: 20
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Shared authentication library for authenticating with turing platform applications using GitHub Oauth and GitHub teams.
Add this line to your application's Gemfile:
'turing_auth'
And then execute:
$ bundle
Or install it yourself as:
$ gem install turing_auth
To use the Oauth portions of the gem, you need to provide an oauth Client ID and Client Secret. This looks like:
ngAuth.client_id = "my client id"
ngAuth.client_secret = "my client secret"
Additionally, an admin token for the Turing org is need in order to access Turing github team data and determine whether a user is a member of an authorized team:
ngAuth.admin_token = "my admin token"
Finally, you need to call TuringAuth.init!
to take the provided
keys and activate the Github omniauth provider. All together this looks like:
ngAuth.client_id = "my client id"
ngAuth.client_secret = "my client secret"
ngAuth.admin_token = "my admin token"
ngAuth.init!
An application initializer is usually a good place to do this configuration.
Authorized teams are stored in TuringAuth::Teams.authorized_teams
as a mapping of team name to github team id. To authorize a new
team it needs to be added to this mapping.
To see the list of available Turing teams that you can add,
use the TuringAuth::Teams#list_teams
method. Note that you'll need
to configure the Turing admin token as mentioned above
in order to make this api query.
Once you have a list of teams, find the one you want to authorize, and add its name/id mapping to the list.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)