1. Deepak Sharma
  2. PowerServer
  3. Thursday, 12 October 2023 10:22 AM UTC

Power Builder supports authenticating a of SQL Anywhere database but do PowerServer 2022 environment supports authenticating SQL Anywhere database using an authentication string.

Wil it supports a sample string like:

EXECUTE IMMEDIATE "SET TEMPORARY OPTION connection_authentication='Company=MyCo;Application=MyApp;Signature=0fa551599998e14d818e...';"
USING SQLCA

 

Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 13 October 2023 08:35 AM UTC
  2. PowerServer
  3. # 1

Hi Deepak,

This ASA database connection_authentication option can be set for an individual connection only. But PowerServer is using short-lived connections by default (refer to: Connection differences - - PowerServer 2022 R2 Help (appeon.com)), so the connection-related options will not work in the other automatically created database connections.

There are two workarounds:

1) Add InitString in the ASA connection string.

Open the generated C# solution, Find UserExtensions -> AppConfig -> Applications.json

Edit the value of OtherOptions, e.g.:

"OtherOptions": "InitString=\"SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=Appeon;Application=MyApp;Signature=123'\"",

{
  "Applications": {
    "retrievedemo": {
      "CloudTransactions": {
        "sqlca": {
          "CacheName": "pbdemo"
        }
      },
      "Transaction": {
        "Timeout": 120,
        "TransactionException": true
      },
      "Session": {
        "Timeout": 3600
      },
      "Request": {
        "Timeout": 3600
      },
      "RunMode": 0,
      "MaxSPCache": 50
    }
  },
  "Connections": {
    "Default": {
      "pbdemo": {
        "ConnectionType": "Odbc",
        "OdbcName": "PB Demo DB V2022R2",
        "OdbcDriver": "SqlAnywhere",
        "UserID": "dba",
        "Password": "s",
        "CommandTimeout": 30,
        "SecurityOptions": null,
        "OtherOptions": "InitString=\"SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=Appeon;Application=MyApp;Signature=123'\"",
        "DynamicConnection": false
      }
    }
  }
}

Please notice that OtherOptions values will be overridden by default when you deploy the PowerServer project next time. You can go to PowerServer project - Build - Basic - Web APIs, and uncheck Overwrite server settings.

Maybe you can also edit InitString in the ODBC configuration. E.g.: InitString SqlAnywhere 12 Authentication in ODBC - Stack Overflow

2) Use long-running connections if you don't have too many users in this application. It will work similarly to the native PB app but may occupy more database connections on the Server. Enabling long connections - - PowerServer 2022 R2 Help (appeon.com)

Regards, Logan

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.