while connecting server via matlab , C? How to resolve? without using passwor
古いコメントを表示
when im using system command.
system('\*.exe -s serverhostname:port)
its shows --> The server requests you to open the following URL for authentication: https://
How to resolve in matlab without using username and password. via access_token
7 件のコメント
Manikanta Aditya
2024 年 3 月 21 日
Try this:
command = sprintf('command-line-tool --access-token %s', access_token);
[status, output] = system(command);
Here keep command-line-tool and access-token with your names. Also, please make sure your tool supports access token authentication and you’re using the correct option to provide the access token (in the example, it’s --access-token.)
Dhines
2024 年 3 月 21 日
Manikanta Aditya
2024 年 3 月 21 日
Check this documentation
Dhines
2024 年 3 月 21 日
Manikanta Aditya
2024 年 3 月 21 日
Obtaining an access token typically involves making a request to the service’s authorization server with your client credentials (client ID and client secret). The specific details can vary depending on the service you’re using.
I can mention a very simple and basic example which can workout for you:
url = 'https://your-service.com/oauth/token';
options = weboptions('RequestMethod','post', 'MediaType','application/x-www-form-urlencoded');
data = ['grant_type=client_credentials&client_id=your-client-id&client_secret=your-client-secret'];
response = webread(url, data, options);
access_token = response.access_token;
Manikanta Aditya
2024 年 3 月 21 日
https://www.mathworks.com/help/matlab/ref/webread.html
Dhines
2024 年 3 月 21 日
回答 (1 件)
Dinesh
2024 年 3 月 21 日
Hello,
The first step is to obtain an access token from the service that you are using.
Then, you can include the access token in the "system" command to automate this process of logging in without providing a username and password.
Depending on the CLI application you are using, the command might be different.
The following is an example:
system('YourApplication.exe -s serverhostname:port --access-token YOUR_ACCESS_TOKEN');
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!