modified to use Auth::OmniAuth::Path
183981
def callback_path
	      @callback_path ||= begin
	        path = options[:callback_path] if options[:callback_path].is_a?(String)
	        path ||= current_path if options[:callback_path].respond_to?(:call) && options[:callback_path].call(env)
	        path ||= custom_path(:request_path)
	        path ||= Auth::OmniAuth::Path.common_callback_path(name)
	        path
	      end
	    end
1168939
def parse_auth(rule):
    '''
    
    '''
    parser = argparse.ArgumentParser()
    rules = shlex.split(rule)
    rules.pop(0)
    noargs = ('back', 'test', 'nostart', 'kickstart', 'probe', 'enablecache',
              'disablecache', 'disablenis', 'enableshadow', 'disableshadow',
              'enablemd5', 'disablemd5', 'enableldap', 'enableldapauth',
              'enableldaptls', 'disableldap', 'disableldapauth',
              'enablekrb5kdcdns', 'disablekrb5kdcdns', 'enablekrb5realmdns',
              'disablekrb5realmdns', 'disablekrb5', 'disablehe-siod',
              'enablesmbauth', 'disablesmbauth', 'enablewinbind',
              'enablewinbindauth', 'disablewinbind', 'disablewinbindauth',
              'enablewinbindusedefaultdomain', 'disablewinbindusedefaultdomain',
              'enablewins', 'disablewins')
    for arg in noargs:
        parser.add_argument('--{0}'.format(arg), dest=arg, action='store_true')

    parser.add_argument('--enablenis', dest='enablenis', action='store')
    parser.add_argument('--hesiodrhs', dest='hesiodrhs', action='store')
    parser.add_argument('--krb5adminserver', dest='krb5adminserver',
                        action='append')
    parser.add_argument('--krb5kdc', dest='krb5kdc', action='append')
    parser.add_argument('--ldapbasedn', dest='ldapbasedn', action='store')
    parser.add_argument('--ldapserver', dest='ldapserver', action='append')
    parser.add_argument('--nisserver', dest='nisserver', action='append')
    parser.add_argument('--passalgo', dest='passalgo', action='store')
    parser.add_argument('--smbidmapgid', dest='smbidmapgid', action='store')
    parser.add_argument('--smbidmapuid', dest='smbidmapuid', action='store')
    parser.add_argument('--smbrealm', dest='smbrealm', action='store')
    parser.add_argument('--smbsecurity', dest='smbsecurity', action='store',
                        choices=['user', 'server', 'domain', 'dns'])
    parser.add_argument('--smbservers', dest='smbservers', action='store')
    parser.add_argument('--smbworkgroup', dest='smbworkgroup', action='store')
    parser.add_argument('--winbindjoin', dest='winbindjoin', action='store')
    parser.add_argument('--winbindseparator', dest='winbindseparator',
                        action='store')
    parser.add_argument('--winbindtemplatehomedir',
                        dest='winbindtemplatehomedir', action='store')
    parser.add_argument('--winbindtemplateprimarygroup',
                        dest='winbindtemplateprimarygroup', action='store')
    parser.add_argument('--winbindtemplateshell', dest='winbindtemplateshell',
                        action='store')

    parser.add_argument('--enablekrb5', dest='enablekrb5', action='store_true')
    if '--enablekrb5' in rules:
        parser.add_argument('--krb5realm', dest='krb5realm', action='store',
                            required=True)
    parser.add_argument('--enablehesiod', dest='enablehesiod',
                        action='store_true')
    if '--enablehesiod' in rules:
        parser.add_argument('--hesiodlhs', dest='hesiodlhs', action='store',
                            required=True)

    args = clean_args(vars(parser.parse_args(rules)))
    parser = None
    return args
1003106
def authcode_get(self, path, **kwargs):
        
        kwargs.setdefault('params', {})['authcode'] = self.authcode
        return self._session.okc_get(path, **kwargs)
1069383
def post_with_auth(path, response_class, payload)
      response_class.new(client.post_with_auth(path, payload))
    end
1295624
function authLink(path = 'auth') {
  return dropbox.getAuthenticationUrl(
    `${window.location.origin}/${path}`,
    btoa(JSON.stringify({handler: 'dropbox', origin: window.location.origin}))
  )
}
684378
private boolean authorizedPath(AuthContext context, Path path, String action) {
        Decision evaluate = context.evaluate(
                resourceForPath(path),
                action,
                environmentForPath(path)
        );
        return evaluate.isAuthorized();
    }
16962
def _validate_auths(self, path, obj, app):
        
        errs = []

        for k, v in six.iteritems(obj.authorizations or {}):
            if k not in app.raw.authorizations:
                errs.append('auth {0} not found in resource list'.format(k))

            if app.raw.authorizations[k].type in ('basicAuth', 'apiKey') and v != []:
                errs.append('auth {0} should be an empty list'.format(k))

        return path, obj.__class__.__name__, errs
767395
def get(path, params = nil, headers = {}, auth = true)
      request(path: path, query: params, headers: headers, auth: auth)
    end
183861
def search_auth(self, list_or_file_path, source):
        
        _auth = source.args['auth']
        if isinstance(_auth, str):
            if ':' in _auth:
                _auth = _auth.split(':')
            elif _auth.endswith('}') and (
                    _auth.startswith('{') or ':' in _auth):  # {auth}, {user}:{password}, user:{password}
                _auth = self.get_auth(list_or_file_path, _auth)
                _auth = self.split_auth(_auth)

        if isinstance(_auth, list):
            for i in range(len(_auth)):
                if _auth[i].endswith('}') and (
                        _auth[i].startswith('{') or ':' in _auth[i]):  # {auth}, {user}:{password}, user:{password}
                    _auth[i] = self.get_auth(list_or_file_path, _auth[i])
                    if ':' in _auth[i]:
                        _auth = self.split_auth(_auth[i])

        source.args['auth'] = _auth
662273
function() {
      if( StackMob['useRelativePathForAjax'] ){
        // Build "relative path" (also used for OAuth signing)
        return StackMob.apiDomain ? StackMob.apiDomain : (this.getHostname() + (this.getPort() ? ':' + this.getPort() : '')) + '/';
      } else {
        // Use absolute path and operate through CORS
        return StackMob.apiDomain ? StackMob.apiDomain : (StackMob['API_SERVER'] + '/');
      }
    }
833007
def hash_key_path(hash, *path)
      result = nil

      path.each do |key|
        return nil unless hash.respond_to? :"[]"
        result = hash = hash[key]
      end

      return result
    end
697622
def _update_aws_include_relative_path(template_dict, original_root, new_root):
    

    for key, val in template_dict.items():
        if key == "Fn::Transform":
            if isinstance(val, dict) and val.get("Name") == "AWS::Include":
                path = val.get("Parameters", {}).get("Location", {})
                updated_path = _resolve_relative_to(path, original_root, new_root)
                if not updated_path:
                    # This path does not need to get updated
                    continue

                val["Parameters"]["Location"] = updated_path

        # Recurse through all dictionary values
        elif isinstance(val, dict):
            _update_aws_include_relative_path(val, original_root, new_root)
        elif isinstance(val, list):
            for item in val:
                if isinstance(item, dict):
                    _update_aws_include_relative_path(item, original_root, new_root)

    return template_dict
763459
def require_authentication!(options = {})
      options.reverse_merge!(as: :user)
      return if self.class.allow_actions == :all
      return if self.class.allow_actions.present? && params[:action].to_sym.in?(self.class.allow_actions)

      unless signed_in?(options)
        session["#{options[:as]}_return_to"] = request.url if request.get?
        redirect_to new_session_path_for(options[:as])
      end
    end
816598
def apply_basic_auth(params)
      headers = params.fetch(:headers, {})
      headers = basic_auth_header.merge(headers)
      params.merge(:headers => headers)
    end
926295
def post_with_auth(path, payload)
      @connection.post(
        path,
        payload.merge(client_id: @client_id, secret: @secret)
      ).body
    end
1006157
function DiscogsOAuth(auth){
	this.config = util.merge({}, defaultConfig);
	this.auth = {method: 'oauth', level: 0};
	if(auth && (typeof auth === 'object') && (auth.method === 'oauth')){
		util.merge(this.auth, auth);
	}
}
1034375
def options(path, options = {}, &block)
      perform_request Net::HTTP::Options, path, options, &block
    end