When creating a GridClient, you can use an access key for authentication. The access key represents a combination of username, project name, and password.
Access keys have a limited lifespan, and once a key's expiry date has passed, it can no longer be used for authentication.
Your key is tied to your project and your login password. If you are using multiple projects, each will need to have its own key. If you change your password, your keys will become invalid and you'll need to re-generate them.
Whenever a user is created or a user had changed his password, an access key is generated.
View the Access Key
- In the Cloud UI, click on user's profile and then click "Get Access Key".
- Access key dialog will open.
- Enter your login password to view your Access key
- Your new key is now visible in the text box:
- Make a note of your key text, and click "Close".
To invalidate your keys, simply change your password.
You can now use your key to authenticate a GridClient:
Gridclient grid = new GridClient(<accessKey>(string), <CloudServerAddress>(string), <cloudServerPort>(int), <isCloudServerSecured>(boolean)); grid.lockDeviceForExecution(<testName>(string), <device Xpath query>(string), <reservation time in minuets>(int), <Timeout waiting for device in miliseconds(long));
You can now use your key to authenticate Appium:
// specify access key via desired capabilities DesiredCapabilities dc = new DesiredCapabilities(); dc.setCapability("accessKey", accessKey); AndroidDriver driver = new AndroidDriver<>(new URL("http://"+cloudHostAndPort+"/wd/hub"), dc);
// specify access key via URL user info part AndroidDriver driver = new AndroidDriver<>(new URL("http://any:"+accessKey+"@"+host+":"+port+"/wd/hub"), dc);
You can now use your key to authenticate API V1 calls: