diaspora/app/controllers/api/openid_connect/user_info_controller.rb
theworldbright a76f51a6a5 Use redirect_uri if no sector identifier for ppid
As according to http://openid.net/specs/openid-connect-core-1_0.html#PairwiseAlg:

"If the Client has not provided a value for
sector_identifier_uri in Dynamic Client Registration
[OpenID.Registration], the Sector Identifier used
for pairwise identifier calculation is the host
component of the registered redirect_uri."
2016-01-04 16:49:55 +09:00

19 lines
472 B
Ruby

module Api
module OpenidConnect
class UserInfoController < ApplicationController
include Api::OpenidConnect::ProtectedResourceEndpoint
before_action do
require_access_token %w(openid)
end
def show
render json: current_user, serializer: UserInfoSerializer, authorization: current_token.authorization
end
def current_user
current_token ? current_token.authorization.user : nil
end
end
end
end