Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
create_request_token
def create_request_token(params={})
if params[:scope]
scope_uri = URI.parse(params[:scope])
# XXX ignoring host:port and assuming it's our host:port
filepath = RAILS_ROOT + '/public' + scope_uri.path
if File.exist?(filepath)
# valid asset is required
asset = CGI::parse(scope_uri.query)['asset'][0]
unless asset.blank?
group = Group.find_by_asset(asset)
RequestToken.create(:client_application => self,
:scope => params[:scope],
:group_id => group.id,
:callback_url=>self.token_callback_url) unless group.nil?
end
else
logger.info "XXX create_request_token - file not found: #{scope_uri.path}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.