Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stefano Beretta 102 posts 247 karma points
    Oct 24, 2024 @ 07:33
    Stefano Beretta
    0

    uSync - Website with basic authentication enabled

    Hi everyone!

    I'd like you help to understand if it's possible to authenticate uSync calls with a basic authentication (HTTP 401 challenge).

    Our costumer foced us to have the staging environment protected by a basic authentication (HTTP 401 challenge), and when I add the staging instance in the servers list of uSync publisher (on another instance, obv) it doesn't connect.

    In the logs i have a warining during the call

    "www.stagingexample.com/umbraco/uSyncReceive/uSyncReceiveApi/Enabled"
    

    it says

    Connection error: "Unauthorized" 401 - Unauthorized: Access is denied due to invalid credentials.You do not have permission to view this directory or page using the credentials that you supplied.
    

    Is there a way to bypass or authenticate the calls to the staging server?

    Umbraco 13.5.2 - uSync 13.1.7

    Thank you so much

  • Kevin Jump 2348 posts 14896 karma points MVP 8x c-trib
    Oct 24, 2024 @ 08:39
    Kevin Jump
    0

    Hi,

    If you are using Umbraco's Basic authentication setup then there is a way to bypass is.

    if both servers are setup to use basic auth then these settings will be used. if the server you are sending from isn't then you can set a custom header in uSync's publisher settings to send the correct token.

    e.g

      "uSync": {
        "Publisher": {
          "Settings": {
            "IncomingEnabled": true,
            "AppId": "YOUR_APP_ID",
            "AppKey": "YOUR_APP_KEY",
            "RequestHeaders": {
              "X-Authentication-Shared-Secret": "YOUR_AUTH_SECRET"
            }
          }
        }
      },
    

    if you have the whole site behind IIS / serve auth then you would need to exempt the /umbraco/uSyncReceive url from the basic auth for it to get past.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies