Spaces:
Sleeping
Sleeping
|
Download root/api/oauth_guide.md from MalharOrganization/RL-Doc-Parser: direct link, hf CLI and curl.
- Browser
- Download file 641 Bytes
-
https://huggingface.co/spaces/MalharOrganization/RL-Doc-Parser/resolve/main/root/api/oauth_guide.md
- Command line
-
hf download hf://spaces/MalharOrganization/RL-Doc-Parser/root/api/oauth_guide.md
-
curl -L -o oauth_guide.md https://huggingface.co/spaces/MalharOrganization/RL-Doc-Parser/resolve/main/root/api/oauth_guide.md
641 Bytes
OAuth2 Authentication Guide
Overview
This guide explains how to authenticate API requests using OAuth2.
Getting an Access Token
Make a POST request to the token endpoint:
curl -X POST https://api.example.com/auth/token \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Using the Access Token
Include the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.example.com/data
Token Expiration
Access tokens expire after 1 hour. Refresh tokens can be used to obtain new access tokens.