while connecting server via matlab , C? How to resolve? without using passwor

조회 수: 3 (최근 30일)
Dhines
Dhines 2024년 3월 21일
댓글: Dhines 2024년 3월 21일
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
Manikanta Aditya 2024년 3월 21일
https://www.mathworks.com/help/matlab/ref/webread.html
Dhines
Dhines 2024년 3월 21일
thanks for the reply!!
here you mentioned ,
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'];
inside ,
  1. weboptions('RequestMethod','post', 'MediaType','application/x-www-form-urlencoded');
a. RequestMethod
b. post
c. MediaType
d. application/x-www-form-urlencoded
We need to mention?
2. data = ['grant_type=client_credentials&client_id=your-client-id&client_secret=your-client-secret'];
E.g, data = ['grant_type=client_credentials&client_id=748c1jk09-4090-09c79-kff40c-fcc9ee4f9863&client_secret=your-client-secret'];
what are the other things i want to mention? i have client id that one i mentioned above.
client secret where can i get?

댓글을 달려면 로그인하십시오.

답변 (1개)

Dinesh
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');
  댓글 수: 1
Dhines
Dhines 2024년 3월 21일
@Dinesh thanks, the command which you given above thats fine.
how to obtain access token ? is any Matlab code available for this ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by