Authentication
Authentication methods for the WordPress REST API
- class wp_api.auth.BasicAuth(username, password)[source]
Bases:
objectBasic Authentication for WordPress REST API
Note: This method is not recommended for production use unless over HTTPS
- authenticate(session)[source]
Add authentication to session
- Parameters:
session (requests.Session) – The session to authenticate
- Return type:
- class wp_api.auth.ApplicationPasswordAuth(username, app_password)[source]
Bases:
objectApplication Password Authentication for WordPress REST API
This is the recommended authentication method for WordPress 5.6+
- authenticate(session)[source]
Add authentication to session
- Parameters:
session (requests.Session) – The session to authenticate
- Return type:
- class wp_api.auth.OAuth1(consumer_key, consumer_secret, token=None, token_secret=None)[source]
Bases:
objectOAuth1 Authentication for WordPress REST API
- __init__(consumer_key, consumer_secret, token=None, token_secret=None)[source]
Initialize OAuth1 Authentication
- authenticate(session)[source]
Add authentication to session
- Parameters:
session (requests.Session) – The session to authenticate
- Return type: