Class OAuth::Server
In: lib/oauth/server.rb
Parent: Object

This is mainly used to create consumer credentials and can pretty much be ignored if you want to create your own

Methods

Included Modules

OAuth::Helper

Attributes

base_url  [RW] 

Public Class methods

Create a new server instance

[Source]

# File lib/oauth/server.rb, line 17
    def initialize(base_url, paths = {})
      @base_url = base_url
      @paths = @@server_paths.merge(paths)
    end

Public Instance methods

[Source]

# File lib/oauth/server.rb, line 58
    def access_token_path
      @paths[:access_token_path]
    end

[Source]

# File lib/oauth/server.rb, line 62
    def access_token_url
      base_url + access_token_path
    end

[Source]

# File lib/oauth/server.rb, line 50
    def authorize_path
      @paths[:authorize_path]
    end

[Source]

# File lib/oauth/server.rb, line 54
    def authorize_url
      base_url + authorize_path
    end

mainly for testing purposes

[Source]

# File lib/oauth/server.rb, line 31
    def create_consumer
      creds = generate_credentials
      Consumer.new(creds[0], creds[1],
        {
          :site               => base_url,
          :request_token_path => request_token_path,
          :authorize_path     => authorize_path,
          :access_token_path  => access_token_path
        })
    end

[Source]

# File lib/oauth/server.rb, line 26
    def generate_consumer_credentials(params = {})
      Consumer.new(*generate_credentials)
    end

[Source]

# File lib/oauth/server.rb, line 22
    def generate_credentials
      [generate_key(16), generate_key]
    end

[Source]

# File lib/oauth/server.rb, line 42
    def request_token_path
      @paths[:request_token_path]
    end

[Source]

# File lib/oauth/server.rb, line 46
    def request_token_url
      base_url + request_token_path
    end

[Validate]