alphagov/signonotron2 — pull request #91 by JordanHatch (2013-10-03 15:38:44+00:00)
Title: Sync SSO permissions and suspensions using bearer tokens

Right now, we use the basic auth authentication method of gds-sso to make requests to apps whenever we update permissions or suspend a user. This pull request removes the use of basic auth in favour of bearer tokens, which is more consistent with how our other services make requests to each other.

In order to do this, a user must be created which will be used to authorise requests. The email address for this user is configured in `config/initializers/sso_push.rb`. If no user is provided, or if the user does not exist, syncing will fail - however it will fail gracefully and user updates can still be persisted in Signonotron.

When the configured user does exist, the `SSOPushCredential` class will ensure the right permissions and authorisations are in place, and return the correct bearer token for the app, on an app-by-app basis. This means that we don't have to manually update the user each time a new app is created, and we don't have a single access token shared between all apps.

This will require a configuration change to alphagov-deployment before this can be merged and deployed to preview.