Class: OAuth2::Strategy::Implicit

Inherits:
Base
  • Object
show all
Defined in:
lib/oauth2/strategy/implicit.rb

Overview

The Implicit Strategy

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OAuth2::Strategy::Base

Instance Method Details

#authorize_params(params = {}) ⇒ Object

The required query parameters for the authorize URL

Parameters:

  • params (Hash) (defaults to: {})

    additional query parameters



12
13
14
# File 'lib/oauth2/strategy/implicit.rb', line 12

def authorize_params(params = {})
  params.merge('response_type' => 'token', 'client_id' => @client.id)
end

#authorize_url(params = {}) ⇒ Object

The authorization URL endpoint of the provider

Parameters:

  • params (Hash) (defaults to: {})

    additional query parameters for the URL



19
20
21
22
# File 'lib/oauth2/strategy/implicit.rb', line 19

def authorize_url(params = {})
  assert_valid_params(params)
  @client.authorize_url(authorize_params.merge(params))
end

#get_tokenObject

Not used for this strategy

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/oauth2/strategy/implicit.rb', line 27

def get_token(*)
  raise(NotImplementedError, 'The token is accessed differently in this strategy')
end