oauth 인증을 사용하여 간단한 나머지 API 작업을하고 있습니다. OAuthStorage :: __ construct()는 UserManager의 인스턴스 인 UserProviderInterface를 구현해야합니다.
는 내가이 설정 모두에 튜토리얼 다음 나는 다음과 같은 방법으로fos_oauth_server:
db_driver: orm
client_class: UserBundle\Entity\Client
access_token_class: UserBundle\Entity\AccessToken
refresh_token_class: UserBundle\Entity\RefreshToken
auth_code_class: UserBundle\Entity\AuthCode
service:
user_provider: fos_user.user_provider.username_email
에 config.yml을 변경 모두를 설치 한 후
https://gist.github.com/tjamps/11d617a4b318d65ca583
(난 깨끗한 설치 심포니 3 응용 프로그램 시작) 다음
나는 또한 로그인시 사용자 이름과 전자 메일을 허용하도록 security.yml을 변경했습니다.
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
# http://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_provider.username_email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
oauth_token: # Everyone can access the access token URL.
pattern: ^/oauth/v2/token
security: false
api:
pattern: ^/ # All URLs are protected
fos_oauth: true # OAuth2 protected resource
stateless: true # Do no set session cookies
anonymous: false # Anonymous access is not allowed
아니오 나는 다음과 같은 오류가 발생합니다 :
치명적인 오류 : catch되지 않은 예외 메시지 '캐치 할 치명적 오류와'심포니 \ 구성 요소 \ 디버그 \ 예외 \의 ContextErrorException ': FOS \ OAuthServerBundle \ 스토리지에 전달 된 인수 (5) \ OAuthStorage :: __ construct() 은/Users/% username/rai-api /에서 호출 된 인터페이스 Symfony \ Component \ Security \ Core \ User \ UserProviderInterface, i FOS \ UserBundle \ Doctrine \ var/cache/prod/appProdProjectContainer.php , 1614 줄에 '/Users/% use에 정의 됨 RNAME/라이-API/공급 업체/friendsofsymfony/OAuth를-서버 번들/저장/OAuthStorage.php 라인에 80
내가 사용하고 심포니 3.2
thnx 고정 : – Jeroen
안녕하세요. 행복한 코딩! –