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

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    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:image

Answers

  • 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

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

    Kind regards,

    Johan