Sha256: 1fb8badd151913f1d599f82b2a00e2cd2434bb6f1e3d0a06c5c7251bb3b066ab

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

Capcoauth.configure do |config|

  raise 'CapcOAuth Client ID not found' if ENV['CAPCOAUTH_CLIENT_ID'].nil?
  raise 'CapcOAuth Client secret not found' if ENV['CAPCOAUTH_CLIENT_SECRET'].nil?

  # CapcOAuth Client ID
  config.client_id ENV['CAPCOAUTH_CLIENT_ID']

  # CapcOAuth Client Secret
  config.client_secret ENV['CAPCOAUTH_CLIENT_SECRET']

  # Configures how often to check CapcOAuth for access token validity, in seconds.  If this value is too high,
  # application will continue to serve requests to users even after the token is revoked
  # config.token_verify_ttl 10

  # Configure CapcOAuth service URL
  # config.capcoauth_url ENV['CAPCOAUTH_URL']

  # Configure the logger to use for OAuth events
  config.logger Rails.logger

  # Configure which ID to identify the user by.  Valid options are :capcoauth, :capco (4-letter), :psoft, :e_number, and :cit
  # config.user_id_field :capcoauth

  # Block to resolve your user from the provided CapcOAuth ID.  If you're using different primary keys than any of the
  # existing services, you might consider looking up by an external ID, e.g. `User.find_by_psoft_id! capcoauth_user_id`
  config.user_resolver do |capcoauth_user_id|
    User.find capcoauth_user_id
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capcoauth-0.3.1 lib/generators/capcoauth/templates/initializer.rb
capcoauth-0.3.0 lib/generators/capcoauth/templates/initializer.rb