/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $query = $this->db->createQueryBuilder()->insert('oauth_access_token_scopes')->values(['access_token' => ':token', 'scope' => ':scope']); $query->createNamedParameter($token->getId(), \PDO::PARAM_STR, ':token'); $query->createNamedParameter($scope->getId(), \PDO::PARAM_STR, ':scope'); $query->execute(); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $key = RedisUtil::prefix($token->getId(), 'oauth_access_token_scopes'); if (!isset($this->cache[$key])) { $this->cache[$key] = []; } $value = ['id' => $scope->getId()]; array_push($this->cache[$key], $value); RedisCapsule::sadd($key, RedisUtil::prepare($value)); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scopeEntity) { /** @var AccessToken $accessToken */ $accessToken = $this->dm->getRepository(AccessToken::class)->find($token->getId()); /** @var Scope $scope */ $scope = $this->dm->getRepository(Scope::class)->find($scopeEntity->getId()); $accessToken->associateScope($scope); $this->dm->persist($accessToken); $this->dm->flush($accessToken); }
/** * {@inheritdoc} */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { M('oauth_auth_code_scopes')->add(array('auth_code' => $token->getId(), 'scope' => $scope->getId())); }
public function associateScope(SessionEntity $session, ScopeEntity $scope) { $sql = 'INSERT INTO oauth_access_token_scopes' . ' (access_token_id, scope_id)' . ' VALUES' . ' (?, ?);'; $this->db->execute($sql, [$session->getId(), $scope->getId()]); }
public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $this->redis->lpush("access_token:scopes:{$token}", "{$scope->getId()}:{$scope->getDescription()}"); }
/** * {@inheritdoc} */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->getConnection()->table('oauth_session_scopes')->insert(['session_id' => $session->getId(), 'scope' => $scope->getId()]); }
/** * Associate a scope with an acess token * * @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * * @return bool * @throws OAuthException */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $accessTokenScope = new AccessTokenScope(); $accessTokenScope->setAttribute("access_token", $token->getId()); $accessTokenScope->setAttribute("scope", $scope->getId()); $saved = $accessTokenScope->save(); if ($saved) { return $saved; } else { throw new OAuthException(json_encode($accessTokenScope->errors)); } }
/** * Associate a scope with an access token in Redis storage. * * @param \League\OAuth2\Server\Entity\AbstractTokenEntity $token * @param \League\OAuth2\Server\Entity\ScopeEntity $scope * @return void */ public function associateScope(AbstractTokenEntity $token, ScopeEntity $scope) { $this->pushSet($token->getToken(), 'oauth_access_token_scopes', ['id' => $scope->getId()]); }
/** * {@inheritdoc} */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { Capsule::table('oauth_auth_code_scopes')->insert(['auth_code' => $token->getId(), 'scope' => $scope->getId()]); }
/** * {@inheritdoc} */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { Capsule::table('oauth_session_scopes')->insert(['session_id' => $session->getId(), 'scope' => $scope->getId()]); }
/** * Associate a scope with a session * * @param \League\OAuth2\Server\Entity\SessionEntity $session The session * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * * @return null|string * @throws OAuthException */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $sessionScopesStorage = new SessionScopesStorage(); $sessionScopesStorage->setAttribute("session_id", $session->getId()); $sessionScopesStorage->setAttribute("scope", $scope->getId()); if ($sessionScopesStorage->save()) { return $sessionScopesStorage->getPrimaryKey(); } else { throw new OAuthException(json_encode($sessionScopesStorage->errors)); } }
/** * {@inheritdoc} */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { M('oauth_session_scopes')->add(array('session_id' => $session->getId(), 'scope' => $scope->getId())); }
/** * Associate a scope with an acess token * @param \League\OAuth2\Server\Entity\AuthCodeEntity $token The auth code * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * @return void */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->db->insert('oauth_auth_code_scopes', [$token->getId(), $scope->getId()], ['auth_code', 'scope']); }
/** * Associate a scope with a session * @param \League\OAuth2\Server\Entity\SessionEntity $scope The scope * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * @return void */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->db->insert("oauth_session_scopes", [$session->getId(), $scope->getId()], ['session_id', 'scope']); }
/** * Associate a scope with an authorization code in Redis storage. * * @param \League\OAuth2\Server\Entity\AuthCodeEntity $code * @param \League\OAuth2\Server\Entity\ScopeEntity $scope * @return void */ public function associateScope(AuthCodeEntity $code, ScopeEntity $scope) { $this->pushSet($code->getId(), 'oauth_auth_code_scopes', ['id' => $scope->getId()]); }
/** * Associate a scope with a session * * @param SessionEntity $session * @param ScopeEntity $scope * @return void */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->db->table('oauth_session_scopes')->insert(['session_id' => $session->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); }
/** * Associate a scope with an acess token * * @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * * @return void */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $this->getEntityManager()->getConnection()->insert('oauth_access_token_scope', ['access_token' => $token->getId(), 'scope' => $scope->getId()]); }
public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->redis->lpush("session:scopes:{$session->getId()}", "{$scope->getId()}:{$scope->getDescription()}"); }
/** * {@inheritdoc} */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->getConnection()->table('oauth_auth_code_scopes')->insert(['auth_code' => $token->getId(), 'scope' => $scope->getId()]); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $this->loadModel('OAuthServer.AccessTokenScopes'); $tokenScope = $this->AccessTokenScopes->newEntity(['oauth_token' => $token->getId(), 'scope_id' => $scope->getId()]); $this->AccessTokenScopes->save($tokenScope); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { M('oauth_access_token_scopes')->add(array('access_token' => $token->getId(), 'scope' => $scope->getId())); }
/** * Associate a scope with an acess token * * @param AuthCodeEntity $token * @param ScopeEntity $scope * @return void */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->db->table('oauth_auth_code_scopes')->insert(['auth_code_id' => $token->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); }
/** * {@inheritdoc} * * @param \League\OAuth2\Server\Entity\SessionEntity $session Session entity * @param \League\OAuth2\Server\Entity\ScopeEntity $scope Scope entity * @return void */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->loadModel('OAuthServer.SessionScopes'); $sessionScope = $this->SessionScopes->newEntity(['session_id' => $session->getId(), 'scope_id' => $scope->getId()]); $this->SessionScopes->save($sessionScope); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { Capsule::table('oauth_access_token_scopes')->insert(['access_token' => $token->getId(), 'scope' => $scope->getId()]); }
/** * Associate a scope * * @param \League\OAuth2\Server\Entity\ScopeEntity $scope * * @return self */ public function associateScope(ScopeEntity $scope) { if (!isset($this->scopes[$scope->getId()])) { $this->scopes[$scope->getId()] = $scope; } return $this; }
/** * {@inheritdoc} */ public function associateScope(AuthCodeEntity $token, ScopeEntity $scope) { $this->loadModel('OAuthServer.AuthCodeScopes'); $codeScope = $this->AuthCodeScopes->newEntity(['auth_code' => $token->getId(), 'scope_id' => $scope->getId()]); $this->AuthCodeScopes->save($codeScope); }
/** * Associate a scope with a session in Redis storage. * * @param \League\OAuth2\Server\Entity\SessionEntity $session * @param \League\OAuth2\Server\Entity\ScopeEntity $scope * @return void */ public function associateScope(SessionEntity $session, ScopeEntity $scope) { $this->pushSet($session->getId(), 'oauth_session_scopes', ['id' => $scope->getId()]); }
/** * {@inheritdoc} */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $this->getConnection()->table('oauth_access_token_scopes')->insert(['access_token_id' => $token->getId(), 'scope_id' => $scope->getId(), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]); }
/** * Associate a scope with an acess token * @param \League\OAuth2\Server\Entity\AccessTokenEntity $token The access token * @param \League\OAuth2\Server\Entity\ScopeEntity $scope The scope * @return void */ public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { $this->db->insert('oauth_access_token_scopes', [$token->getId(), $scope->getId()], ['access_token', 'scope']); }