Class: Sso::SessionsController

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

Instance Method Summary collapse

Instance Method Details

#createObject

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



28
29
30
31
32
33
34
35
36
# File 'app/controllers/sso/sessions_controller.rb', line 28

def create
  # passport.load_user!
  # passport.create_chip!
  current_client = ::Sso::Client.find_by_access_token(doorkeeper_token.id)
  current_client.update!(client_params)

  @session = current_client.session
  render json: @session, status: :created, serializer: Sso::SessionSerializer
end

#jsonpObject

JSONP endpoint based on Devise session



41
42
43
44
45
# File 'app/controllers/sso/sessions_controller.rb', line 41

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

#mobileObject

Mobile endpoint



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

def mobile
  # TODO : Check inconsistent
  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



20
21
22
23
# File 'app/controllers/sso/sessions_controller.rb', line 20

def show
  @session = current_client.session
  render json: @session, serializer: Sso::SessionSerializer
end