I'm building a web app that needs to login to a 3rd party application and then forward the response back to the browser, so it acts like a proxy. We need this because the user must be logged in automatically in both the other app and in our app. Right now I can send the post request to the other app and I have the response, but couldn't figure out how to forward it back to the browser. From what I know, Rails is using render to build the response object automatically.
 def auth_test
    uri = URI 'login_url'
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    resp = http.post(uri.path, params.to_s)
    logger.info 'Code = ' + resp.code
    logger.info 'Message = ' + resp.message
    resp.each {|key, val| logger.info key + ' = ' + val}
    logger.info "------------------"
    logger.info resp.body
    # if login successful -> login to our app
    # ??? send the response back to the browser (resp) ???
end
Appreciate any help/suggestions.
EDIT
 def auth_test
    uri = URI 'login_url'
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = true
    response = http.post(uri.path, params.to_s)
    logger.info 'Code = ' + response.code
    logger.info 'Message = ' + response.message
    response.each {|key, val| logger.info key + ' = ' + val}
    logger.info "------------------"
    logger.info response.body
    # if login successful -> login to our app
    # ??? send the response back to the browser (resp) ???
    render response
end
 
     
    