def find_for_provider(token, provider)
      return nil unless token['uid']
      props = {:uid => token['uid'].downcase, provider: provider.downcase}
      user = where(props).first
      # create new user if necessary
      unless user
        user = create!(whitelist(props))
        # can we add groups or roles here?
      end
      user
    end
def find_for_provider(token, provider)
      return nil unless token['uid']
      props = {:uid => token['uid'].downcase, provider: provider.downcase}
      user = where(props).first
      # create new user if necessary
      unless user
        user = create!(whitelist(props))
        # can we add groups or roles here?
      end
      user
    end
token is an omniauth hash