fosoauthserverbundle

Symfony2 FOSOAuthServerBundle grant type password requires client secret

筅森魡賤 提交于 2019-12-12 03:16:17
问题 I'm integrating FOSOAuthServerBundle to handle login from a mobile app to a Symfony2 backoffice. I've followed the instructions of this answer, but as I've never used OAuth2 before I'm a bit lost sometimes. I tried logging in using the 'password' grant_type but for some reason it won't work unless I specify the client_secret as a GET parameter. Am I actually supposed to ? Here's what my request looks like: http://myserv.local/app_dev.php/oauth/v2/token ?client_id=1

FOSUserBundle with multiple entity managers - Symfony 2 set up

我的未来我决定 提交于 2019-12-11 12:19:39
问题 I've been using the FOSUserBundle and the FOSOAuthBundle without issue in a project for a while now, but I've recently added another DB connection and another entity manager and, as a result, can no longer rely on auto_mapping. I've added mapping for both of the bundles to one of the entity managers and everything seemed to be working OK. However I've found an issue with the User no longer generating the correct schema when running app/console doctrine:schema:create , suggesting a mapping

Symfony isGranted(“ROLE_ADMIN”) not working properly

久未见 提交于 2019-12-11 06:06:16
问题 I have a security.yaml like this: api_documentary: pattern: ^/api/v1/documentary fos_oauth: true stateless: false methods: [POST, PUT, DELETE] - { path: ^/api/v1/documentary, roles: IS_AUTHENTICATED_ANONYMOUSLY } I want the firewall to be on (accessed by access token) on the following routes ^/api/v1/documentary POST, PUT, DELETE I want the firewall to be off on the routes: GET and GET ALL If I exclude GET from methods: [] above I can access them publicly, however something weird happens: The

Symfony2 OAuth keeps giving me a login page when a token is provided

拟墨画扇 提交于 2019-12-06 04:32:09
I have setup an app with: FriendsOfSymfony/FOSUserBundle FriendsOfSymfony/FOSOAuthServerBundle FriendsOfSymfony/FOSRestBundle I have successfully created a client and can get an access token using a url like this http://api.mydomain.com/oauth/v2/token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=password&username=mikebates&password=secret However, when I then try to access the a url like this http://api.mydomain.com/api/surgeries/45/details?access_token=ACCESS_TOKEN I get redirected to the symfony login page, but I can't have that or the mobile app I'm build to consume this REST

FOSOAuthServerBundle with FOSUserBundle - How to make it works?

心不动则不痛 提交于 2019-12-03 10:12:40
问题 Currently my project works very well. I use FOSUserBundle for the management of my users. Now, I want to implement OAuth, so I'm using FOSOAuthServerBundle. Most of developers recommend this bundle for implement OAuth. I followed the documentation of FOSOAuthServerBundle. Normally, I have to add more information in my security.yml but I don't know exactly what I have to do ... Here is my security.yml : security: encoders: Symfony\Component\Security\Core\User\User: plaintext Moodress\Bundle

Symfony Security: Auth with session or oauth

拜拜、爱过 提交于 2019-11-29 12:01:56
I have developed a REST API, there are two ways to connect to it: session and oauth. Basically, my website will use the session mode and third-party softwares will use the oauth mode. I managed to make make both session and oauth modes to work in symfony, but I can't make them work at the same time. Here is my firewalls security config: firewalls: auth_oauth_token: pattern: ^/auth/oauth/v2/token security: false api: pattern: ^/api anonymous: false fos_oauth: true stateless: true auth: pattern: ^/ anonymous: ~ form_login: login_path: /auth/session/check check_path: /auth/session/login always

How to implement FosOAuthServerBundle to secure a REST API?

拜拜、爱过 提交于 2019-11-28 03:02:23
I would like to provide a RESTful API secured with OAuth2 using FOSOAuthServerBundle and I'm not really sure about what I have to do. I followed basic steps from the documentation but some things are missing and I can't find a complete example of what I need. So, I tried to understand the best I could this example of implementation (the only one I found) but there are still things I don't understand. First, why do we need a login page in an API? Let's suppose my client is a iPhone or Android App, I see the interest of the login page on the app, but I think the client have just to call a