JSON Web Token (JWT) is a JSON encoded open, industry-standard RFC 7519 method representation of a claim(s) that can be transferred between two parties. The claim is digitally signed by the issuer of the token, and the party receiving this token can later use this digital signature to prove the ownership of the claim.
At Aspose, we value data integrity and authentication as much as we focus on new features building. Therefore, all Aspose.Cloud APIs are only accessible to authorized persons. Also, the files that we store in cloud storage become available through that account that we use to upload. So in order to interact with Aspose.Cloud APIs, you need to first obtain your specific Client ID and Client Secret keys.
- Please visit Aspose.Cloud dashboard website. You will be redirected to the Aspose Single Sign-On authentication service.
- If you have GitHub or Google account, simply Sign Up. Otherwise, click on the Create a new Account button and provide the required information.
Congratulations! We have successfully created an account and can access Aspose Cloud Dashboard.
Now login to the dashboard and expand the Applications section from the dashboard and scroll down towards the Client Credentials section to see Client ID and Client Secret details.
Using Client credentials with SDK
You may use Aspose Cloud SDKs to call Aspose REST APIs as SDKs take care of low-level details of authenticating, making requests, and handling responses and let you focus on writing code specific to your project. SDKs are provided for different programming languages and mobile platforms. So in order to access Cloud APIs using SDKs, you need to use your Client ID and Client Secret.
C# .NET
API References section
We need to use the Client ID and Client Secret to access Cloud API References in swagger view. So in case, you need to access Aspose.Words Cloud via swagger view, click Authorize button, and enter your personalized Client ID and Client Secret details obtained from Aspose.Cloud dashboard.
JWT Token Generation
In order to use Cloud APIs through the command prompt, you need to generate your JWT token using a Client ID and Client Secret.
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxxxx-1c8e-4ea4-a948-3857547232fa&client_secret=xxxxxxx3e329cdf5694cc96a" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
The JWT token displays in the console. Now we can use the same token to access Aspose.Cloud APIs and accomplish required features. The following example converts the input marketing.pdf file to MS Word (.docx) using Aspose.Words Cloud API.
curl -v "https://api.aspose.cloud/v4.0/words/marketing.pdf/saveAs" \
-X PUT \
-d "{'SaveFormat':'docx', 'FileName': 'Converted.docx'}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <JWT Access Token>"
Conclusion
The Cloud APIs are reliable and a convenient way to quickly accomplish your desired functionalities. You do not need to download or install any software. Furthermore, the authorization layer enables an extra sense of security, and your private data is only accessible to you. Please try using our Cloud APIs and in case you encounter any issue, please feel free to post your query on Product support forums.