For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
15 4 3 9

How to set up the Python Market Price Authentication - global default variables?

Hi,

I would like to test the Market Price Authentication example but I don't know how to configure below global default variables? Can I by examlpe use DACS as authentication server, or else?

# Global Default Variables
app_id = '555'
auth_hostname = '127.0.0.1'
auth_port = '8443'
hostname = '127.0.0.1'
password = ''
position = socket.gethostbyname(socket.gethostname())
token = ''
user = ''
port = '15000'

Kind regards,

Johan

treprdp-apiwebsocketsrrto
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
11.5k 16 7 10

Hi @johan.lundquist

Basically, if your ADS server already connects to DACS server and use a DACS user directly, you can use a market_price.py application to test authentication feature. Like @julien.dominici answer above, you can just input your valid DACS user credential via a JSON login message as shown below:

{
  "Domain":"Login",
  "ID":1,
  "Key":{
    "Elements":{
      "ApplicationId":"256",
      "Position":"127.0.0.1"
    },
    "Name":"<DACS User>"
  }
}

Please be informed that the market_price_authentication.py application is for Token-Based deployment scenario only. In a token-based model, the client-side application obtains a token (typically a random string2), generated by a token generator (Authentication server which you need to specify via auth_hostname/auth_port variables) based on the user’s credentials. The token is passed to the ADH/ADS, at which point the ADH/ADS makes a call out to the local token authenticator for verification.

The Token-Based deployment diagram is following:


token-base.png (74.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
112 2 5 6

Hi Johan,

If I am correct, it should be the ADS that runs the WS API which will forward your credentials (user, appId, position) to the DACS server, in the example you only need to ensure that your are passing valid credentials (existing DACS user with permission) to the ADS into the login request.

Regards,

Julien

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
15 4 3 9

Thank you for the clarification with regards to the Token-Based deployment.

Kind regards,

Johan

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea