When integrating GXquery 4.0 on our GeneXus applications, one possible solution is to use the URL of a GXquery 4.0 instance.
The information needed as parameters of the URL is the following:
- Repository name (unencrypted, accepts empty if there are no multiple repositories or we want to connect to the default repository)
- GXquery 4.0 User (encrypted)
- GXquery 4.0 Password (encrypted)
The URL will look as follows: http://<Host>/<BaseURL>/login.aspx?<Repository>,<GXquery User>,<GXquery Password>
For example, we can call it on a web panel as shown below:
Event 'CallGXquery'
&URLHttp = 'http://localhost/GXqueryDemo/login.aspx?'
&Encryptionkey = 'b2aff1f14433431fc96e96d7ec6013cb'
&GXqueryUser = Encrypt64('Administrator',&Encryptionkey)
&GXqueryPassword = Encrypt64('administrator123',&Encryptionkey)
&Repository = 'Repository1'
Link(&URLHttp,&Repository,&GXqueryUser,&GXqueryPassword)
EndEvent
The URL will look as follows: http://localhost/GXqueryDemo/login.aspx?Repository1,os7bdYRj+MrVVSmBFuVEbA==,+z8sL5I72oM/YwTB24ad+w==
To encrypt the GXquery 4.0 User and Password we need to use the Encrypt64 function of GeneXus, using the encryption key from the repository on GXquery as a parameter:
Note: The possible values of the encryption key are given by the GetEncryptionKey function of GeneXus.
This feature is available as of GXquery 4.0 Upgrade 2.