We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://api.github.com/groton-school/blackbaud-to-google-group-sync/blob/c6f88d74420b3f7666bfa2bacecd5ad04fcd59e1/src/server/Blackbaud/SKY.php#L105
return self::$cache; } public static function getToken( $server, $session, $get, $interactive = true ) { $token = new AccessToken(Secrets::get(self::Bb_TOKEN, true)); // acquire a Bb SKY API access token /** @var AccessToken|null $token **/ if (empty($token)) { if ($interactive) { // interactively acquire a new Bb access token if (false === isset($get[self::CODE])) { $authorizationUrl = self::api()->getAuthorizationUrl(); $session[self::OAuth2_STATE] = self::api()->getState(); // TODO wipe existing token? self::cache()->set( self::Request_URI, $server['REQUEST_URI'] ); header("Location: $authorizationUrl"); exit(); } elseif ( empty($get[self::STATE]) || (isset($session[self::OAuth2_STATE]) && $get[self::STATE] !== $session[self::OAuth2_STATE]) ) { if (isset($session[self::OAuth2_STATE])) { unset($session[self::OAuth2_STATE]); } throw new Exception( json_encode(['error' => 'invalid state']) ); } else { $token = self::api()->getAccessToken( self::AUTHORIZATION_CODE, [ self::CODE => $get[self::CODE], ] ); Secrets::set(self::Bb_TOKEN, $token); } } else { return null; } } elseif ($token->hasExpired()) { // use refresh token to get new Bb access token $newToken = self::api()->getAccessToken(self::REFRESH_TOKEN, [ self::REFRESH_TOKEN => $token->getRefreshToken(), ]); // FIXME need to handle _not_ being able to refresh! Secrets::set(self::Bb_TOKEN, $newToken); $token = $newToken; } else { self::api()->setAccessToken($token);
The text was updated successfully, but these errors were encountered:
battis
No branches or pull requests
https://api.github.com/groton-school/blackbaud-to-google-group-sync/blob/c6f88d74420b3f7666bfa2bacecd5ad04fcd59e1/src/server/Blackbaud/SKY.php#L105
The text was updated successfully, but these errors were encountered: