<commit_before>require 'openid/store/filesystem'
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google_apps, OpenID::Store::Filesystem.new('/tmp')
  provider :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
  provider :facebook, 'APP_ID', 'APP_SECRET'
  provider :linked_in, 'CONSUMER_KEY', 'CONSUMER_SECRET'
  provider :open_id, OpenID::Store::Filesystem.new('/tmp')
  provider :CAS, :cas_server => 'https://www.example.com/cas'
  provider :LDAP, "My LDAP", :host => 'ldap.example.com', :port => 389, :method => :simple, :base => 'cn=users,dc=example,dc=com', :uid => 'sAMAccountName', :try_sasl => true, :sasl_mechanisms => "GSS-SPNEGO"  
end

# This list will show the first choice as the default, and the rest as potential secondary login methods.
PROVIDERS = [:google_apps, :twitter, :facebook, :linked_in, :open_id, :CAS, :LDAP]


# LDAP
# :port (required) - The LDAP server port.
# :method (required) - May be :plain, :ssl, or :tls.
# :base (required) - The distinguished name (DN) for your organization; all users should be searchable under this base.
# :uid (required) - The LDAP attribute name for the user name in the login form. Typically AD would be 'sAMAccountName' or 'UniquePersonalIdentifier', while OpenLDAP is 'uid'. You can also use 'dn' for the user to put in the dn in the login form (but usually is too long for user to remember or know).
# :try_sasl - Try to use SASL connection to server.
# :sasl_mechanisms - Mechanisms supported are 'DIGEST-MD5' and 'GSS-SPNEGO'

module OmniAuth
  module Strategies
    class LDAP<commit_msg>OmniAuth path prefix needs to be set on subdomains...<commit_after>require 'openid/store/filesystem'
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :google_apps, OpenID::Store::Filesystem.new('/tmp')
  provider :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
  provider :facebook, 'APP_ID', 'APP_SECRET'
  provider :linked_in, 'CONSUMER_KEY', 'CONSUMER_SECRET'
  provider :open_id, OpenID::Store::Filesystem.new('/tmp')
  provider :CAS, :cas_server => 'https://www.example.com/cas'
  provider :LDAP, "My LDAP", :host => 'ldap.example.com', :port => 389, :method => :simple, :base => 'cn=users,dc=example,dc=com', :uid => 'sAMAccountName', :try_sasl => true, :sasl_mechanisms => "GSS-SPNEGO"  
end

# This list will show the first choice as the default, and the rest as potential secondary login methods.
PROVIDERS = [:google_apps, :twitter, :facebook, :linked_in, :open_id, :CAS, :LDAP]

# OmniAuth.config.path_prefix = '/auth' # If you use a subdomain, then this may need to be changed to '/subdomain/auth'

# LDAP
# :port (required) - The LDAP server port.
# :method (required) - May be :plain, :ssl, or :tls.
# :base (required) - The distinguished name (DN) for your organization; all users should be searchable under this base.
# :uid (required) - The LDAP attribute name for the user name in the login form. Typically AD would be 'sAMAccountName' or 'UniquePersonalIdentifier', while OpenLDAP is 'uid'. You can also use 'dn' for the user to put in the dn in the login form (but usually is too long for user to remember or know).
# :try_sasl - Try to use SASL connection to server.
# :sasl_mechanisms - Mechanisms supported are 'DIGEST-MD5' and 'GSS-SPNEGO'

module OmniAuth
  module Strategies
    class LDAP
{'fraction_non_alphanumeric': 0.12454655380894801, 'fraction_numerical': 0.0024183796856106408, 'mean_word_length': 4.951438848920863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5298571', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1086, 'n_words': 379}