I’ve been trying to follow this tutorial: https://docs.juce.com/master/tutorial_online_unlock_status.html
I’m using Ruby on Rails for the server-side implementation, but I’m running into an issue during the “Setting up the back end server” step. Instead of receiving the expected “Sorry, we were not able to authorise your request.” message, I keep getting a “Couldn’t connect to…” error message.
What might I be doing wrong?
Here’s my setup so far:
routes.rb
Rails.application.routes.draw do
post "authorization", to: "authorization#create"
end
authorization_controller.rb
class AuthorizationController < ApplicationController
def create
send_response
end
def send_response
# Build the XML response
response = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
if params[:email] == "test@example.com" && params[:pw] == "test"
response += "<MESSAGE message=\"Thanks for registering our product!\"><KEY>INSERT_KEY_HERE</KEY></MESSAGE>"
else
response += "<ERROR error=\"Sorry, we were not able to authorise your request. Please provide a valid email address and password.\"></ERROR>"
end
# Set the content type to XML
render xml: response, content_type: "text/xml"
end
end
In my class that inherits OnlineUnlockStatus, I’ve overridden the getServerAuthenticationURL() method as follows:
juce::URL getServerAuthenticationURL() override {
return juce::URL("https://localhost:8443/authorization");
}
Am I missing something in the configuration, or is there an issue with how I’m setting up the URL or server-side handling? Any guidance would be greatly appreciated!
