/** * Get authentication URL. * * @param array $params Auth parameters. * @return string */ function getAuthURL(array $params = array()) { $params[RublonAuthParams::FIELD_VERSION] = $this->getVersionDate(); $authString = array(); if (!empty($params)) { $authString['consumerParams'] = RublonSignatureWrapper::wrap($this->getSecretKey(), $params); } $authString[RublonAuthParams::FIELD_SYSTEM_TOKEN] = $this->getSystemToken(); $authString[RublonAuthParams::FIELD_LANG] = $this->getLang(); $authString[RublonAuthParams::FIELD_WINDOW_TYPE] = 'window'; return $this->getAPIDomain() . $this->urlPath . urlencode(base64_encode(json_encode($authString))); }
/** * Get the consumer parameters wrapper to apply in the Rublon button. * * Returns the Signature Wrapper-signed consumer params * to apply in the HTML wrapper of the Rublon button. * * @return array|NULL */ public function getConsumerParamsWrapper() { $consumerParams = $this->getConsumerParams(); if (!empty($consumerParams)) { return RublonSignatureWrapper::wrap($this->getRublon()->getSecretKey(), $consumerParams); } else { return null; } }