How to handle CustomHttpHeaders (htaccess) for Custom Authentication Server?

Hi,

We have a question regarding the your hosted PUN solution.

We want to use a Custom Authentication Server which uses an htacces file.

When connecting with PUN it says:
Operation failed: OperationResponse 230: ReturnCode: 32755 (Custom authentication service error: Error). Parameters: {} Server: NameServer
We assume that this is due to the htaccess file with username and password.

For the Webhooks we are going to use, we will use the CustomHttpHeaders value in the setup, but we cannot find anything in the Custom Authentication Server section.

Can you help us on this issue?

Thank you.

Regards
André

Comments

  • We have now encoded the username and password in the Authentication URL like this:

    https://USERNAME:PASSWORD@ourwebaddress

    This works. However, we need this also for all webhooks.
    But when entering the same stuff for the webhook paths like this:

    BaseUrl=https://USERNAME:PASSWORD@ourwebaddress

    We get the following error when creating a room:
    Operation 227 failed in a server-side plugin. Check the configuration in the Dashboard. Message from server-plugin: Failed to create game on https://XXXX/PathCreate? : 'Unauthorized' httpcode=401 webstatus=7 response='', HttpQueueResult=5.
    
    We tried also customHttpHeaders, but get the same error
    When using the baseURL + the PathCreate value in a Webbrowser we get a correct response, e.g. not a 401.

    Have you an idea?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2019
    Hi @AndreWe,

    1. Make sure custom authentication really works by disabling anonymous user authentication.
    2. WebHooks use HTTP verb/method POST. Custom authentication uses GET.
  • AndreWe
    AndreWe ✭✭
    edited March 2019
    Thank you for the fast response.

    1. Make sure custom authentication really works by disabling anonymous user authentication

    The Allow anonymous clients to connect, independently of configured providers checkbox is Disabled.
    The Reject all clients if not available. is Disabled, e.g. we do not have any key/value pairs there.

    2. WebHooks use HTTP verb/method POST. Custom authentication uses GET.

    How can we use the WebHook with htaccess? Maybe our htaccess is configured in a wrong way, which denies post request? We will check...
  • JohnTube
    JohnTube ✭✭✭✭✭
    The Reject all clients if not available. is Disabled, e.g. we do not have any key/value pairs there.
    That option is not related to having custom key/values but it's how you want auth response to be when your auth provider is down (unreachable, returns HTTP error etc.).
  • Hi,

    we found the issue. The Region values which is send in the PathCreate and PathJoin events are always in upper case. We thought this is in lower case, as we cannot add upper case data in the regions whitelist in your server backend.

    Maybe you can add a note in the section? All the examples for these events shows also upper case, like EU but the explaination texts shows lower case.

    https://doc.photonengine.com/en-us/pun/current/gameplay/web-extensions/webhooks#create

    Just a suggestion o:)
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited March 2019
    Hi @AndreWe,

    Thank you for your suggestion.
    We will take it into consideration and update the docs.

    Region string codes/tokens are case insensitive.