You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the ClientHandler class requires developers to handle OAuth access token management externally. This feature request proposes adding functionality to automatically obtain and store an OAuth access token during the instantiation of ClientHandler, or reuse an existing one if available in the session.
Proposed Feature Details
New Behavior: When the ClientHandler class is instantiated with client_id and client_secret in the options array, it should:
Automatically make a request to the token endpoint to retrieve an OAuth access token.
Store the token in the session for subsequent use, avoiding redundant token requests.
Check the session for an existing valid token before requesting a new one.
Example Syntax
// Instantiation with OAuth credentials$clientHandler = newClientHandler(options: [
'client_id' => 'your-client-id',
'client_secret' => 'your-client-secret'
]);
// Expected behavior:// - Automatically fetches and stores an OAuth access token in the session// - Reuses the token for subsequent requests
Benefits
Improved Developer Experience: Reduces the complexity of handling OAuth token management, allowing developers to focus on core functionality.
Efficiency: Minimizes redundant token requests by reusing valid tokens stored in the session.
Security: Encourages best practices for storing tokens securely and ensures proper handling of sensitive credentials.
Description
Currently, the
ClientHandler
class requires developers to handle OAuth access token management externally. This feature request proposes adding functionality to automatically obtain and store an OAuth access token during the instantiation ofClientHandler
, or reuse an existing one if available in the session.Proposed Feature Details
ClientHandler
class is instantiated withclient_id
andclient_secret
in the options array, it should:Example Syntax
Benefits
Additional Considerations
client_id
,client_secret
).Proposed Workflow
ClientHandler
is created withclient_id
andclient_secret
, the library:The text was updated successfully, but these errors were encountered: