Class: Sso::SessionsController

Inherits:
ApplicationController show all
Includes:
Logging
Defined in:
app/controllers/sso/sessions_controller.rb

Instance Method Summary collapse

Methods included from Logging

#debug, #error, #fatal, #info, #warn

Instance Method Details

#createObject

Passport exchange Passport Strategy first exchange Insider : Client information from Apps should always be trusted



25
26
27
28
29
30
31
32
33
# File 'app/controllers/sso/sessions_controller.rb', line 25

def create
  @client = current_client
  @session = @client.session
  debug { "SessionsController#create - #{@session.inspect}"}
  raise "ResourceOwner from token != session.owner" if doorkeeper_token.resource_owner_id != @session.owner.id

  @client.update_attributes!(client_params)
  render json: @client, status: :created, serializer: Sso::ClientSerializer
end

#jsonpObject

JSONP endpoint based on Devise session



38
39
40
41
42
# File 'app/controllers/sso/sessions_controller.rb', line 38

def jsonp
  # TODO : Check inconsistent
  render :nothing => true
  # respond_with @session, :location => sso.sessions_url
end

#mobileObject

Mobile endpoint



48
49
50
51
52
53
54
55
# File 'app/controllers/sso/sessions_controller.rb', line 48

def mobile
  # TODO : Check inconsistent

  # passport.load_user!
  # passport.create_chip!
  render :nothing => true
  # respond_with @session, :location => sso.sessions_url
end

#showObject

Passport verification Session exists (browser/insider) - return passport state Sessionless (iphone/outsider) Returns passport



17
18
19
20
# File 'app/controllers/sso/sessions_controller.rb', line 17

def show
  @client = current_client
  render json: @client, serializer: Sso::ClientSerializer
end