oauth 令牌存储在其中,Podio::$oauth
因此您可以在想要作为不同实体进行身份验证时切换它。
例如,如果您想在两个不同的应用程序之间切换:
// Authenticate as the first app
Podio::authenticate('app', ...);
// Here you can make API requests as the first app
// When you want to switch, store the current auth before doing your second auth
$first_app_auth = Podio::$oauth;
// Auth as the second app.
Podio::authenticate('app', ...);
// Now you can make API requests as the second app
// ...and switch back to the first app
$second_app_auth = Podio::$oauth;
// Auth as the first app again:
Podio::$oauth = $first_app_auth;
// Make API requests as the first app again