# signet - Module Signet::OAuth2 (v0.22.0)

0.22.0 (latest) 0.21.0 0.20.0 Reference documentation and code samples for the signet module Signet::OAuth2.

An implementation of <http://tools.ietf.org/html/draft-ietf-oauth-v2-10>


<br />

This module will be updated periodically to support newer drafts of the
specification, as they become widely deployed.

## Methods

### .generate_authorization_uri

    def self.generate_authorization_uri(authorization_uri, parameters = {}) -> String

Appends the necessary OAuth parameters to
the base authorization endpoint URI.
**Parameter**

- **authorization_uri** (Addressable::URI, String, #to_str) --- The base authorization endpoint URI.
**Returns**

- (String) --- The authorization URI to redirect the user to.

### .generate_basic_authorization_header

    def self.generate_basic_authorization_header(client_id, client_password) -> String

Generates a Basic Authorization header from a client identifier and a
client password.
**Parameters**

- **client_id** (String) --- The client identifier.
- **client_password** (String) --- The client password.
**Returns**

- (String) --- The value for the HTTP Basic Authorization header.

### .generate_bearer_authorization_header

    def self.generate_bearer_authorization_header(access_token, auth_params = nil) -> String

Generates an authorization header for an access token
**Parameters**

- **access_token** (String) --- The access token.
- **auth_params** (Hash) --- Additional parameters to be encoded in the header
**Returns**

- (String) --- The value for the HTTP Basic Authorization header.

### .parse_authorization_header

    def self.parse_authorization_header(field_value)

### .parse_basic_credentials

    def self.parse_basic_credentials(credential_string)

### .parse_bearer_credentials

    def self.parse_bearer_credentials(credential_string)

### .parse_credentials

    def self.parse_credentials(body, content_type)

**Raises**

- (TypeError)

### .parse_oauth_challenge

    def self.parse_oauth_challenge(challenge_string)

### .parse_www_authenticate_header

    def self.parse_www_authenticate_header(field_value)