Module: Googl::OAuth2

Extended by:
OAuth2
Included in:
OAuth2
Defined in:
lib/googl.rb,
lib/googl/oauth2/utils.rb,
lib/googl/oauth2/server.rb,
lib/googl/oauth2/native.rb

Overview

OAuth 2.0

Google supports three flows of OAuth 2.0

  • client-side

  • server-side

  • native application

Now, gem googl support only client-side and native application.

Defined Under Namespace

Modules: Utils Classes: Native, Server

Instance Method Summary collapse

Instance Method Details

#native(client_id, client_secret) ⇒ Object

OAuth 2.0 for native applications

The native application flow for desktop and mobile applications

client = Googl::OAuth2.native("client_id", "client_secret")


137
138
139
# File 'lib/googl.rb', line 137

def native(client_id, client_secret)
  Googl::OAuth2::Native.new(client_id, client_secret)
end

#server(client_id, client_secret, redirect_uri) ⇒ Object

OAuth 2.0 for server-side web applications

The server-side flow for web applications with servers that can securely store persistent information

client = Googl::OAuth2.server("client_id", "client_secret", "redirect_uri")


127
128
129
# File 'lib/googl.rb', line 127

def server(client_id, client_secret, redirect_uri)
  Googl::OAuth2::Server.new(client_id, client_secret, redirect_uri)
end