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



16
17
18
19
20
21
22
23
24
# File 'app/controllers/sso/sessions_controller.rb', line 16

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

#idObject

JSONP endpoint based on Devise session



29
30
31
# File 'app/controllers/sso/sessions_controller.rb', line 29

def id
  render json:  { passport_id: sso_session_id }
end

#showObject

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



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

def show
  @session = Sso::Session.find(sso_session_id)
  render json: @session, serializer: Sso::SessionSerializer
end