fosoauthserverbundle

FOSOAuthServerBundle and custom authentication provider

依然范特西╮ 提交于 2021-01-27 06:37:35
问题 Edit: Found the error. There is a tiny little peace of code in \vendor\friendsofsymfony\oauth-server-bundle\FOS\OAuthServerBundle\Resources\config\oauth.xml which says: <argument type="service" id="fos_oauth_server.user_provider" on-invalid="null" /> So when your service definition in config.yml is wrong or just a typo (from the original docs) If you're authenticating users, don't forget to set the user provider. Here's an example using the FOSUserBundle user provider: # app/config/config.yml

FOSOAuthServerBundle and custom authentication provider

倾然丶 夕夏残阳落幕 提交于 2021-01-27 06:36:38
问题 Edit: Found the error. There is a tiny little peace of code in \vendor\friendsofsymfony\oauth-server-bundle\FOS\OAuthServerBundle\Resources\config\oauth.xml which says: <argument type="service" id="fos_oauth_server.user_provider" on-invalid="null" /> So when your service definition in config.yml is wrong or just a typo (from the original docs) If you're authenticating users, don't forget to set the user provider. Here's an example using the FOSUserBundle user provider: # app/config/config.yml

FOSOAuthServerBundle and custom authentication provider

谁说胖子不能爱 提交于 2021-01-27 06:36:01
问题 Edit: Found the error. There is a tiny little peace of code in \vendor\friendsofsymfony\oauth-server-bundle\FOS\OAuthServerBundle\Resources\config\oauth.xml which says: <argument type="service" id="fos_oauth_server.user_provider" on-invalid="null" /> So when your service definition in config.yml is wrong or just a typo (from the original docs) If you're authenticating users, don't forget to set the user provider. Here's an example using the FOSUserBundle user provider: # app/config/config.yml

FOSOAuthServerBundle: Invalid grant_type parameter or parameter missing

风流意气都作罢 提交于 2019-12-25 04:26:59
问题 I'm trying to build a REST API using Symfony 3.1 and the FOSRestBundle, FOSUserBundle and FOSOAuthServerBundle. I managed to achieve this following the guide at https://gist.github.com/tjamps/11d617a4b318d65ca583. I'm now struggling at the authentication process. When I make a POST request to the server for authentication (to localhost:8000/oauth/v2/token) with the parameters encoded in json in the request body: { "grant_type": "password", "client_id": "1_myveryverysecretkey", "client_secret"

RESTFul OAuth with FOSOAuthServer / FOSRest & FOSUser

风格不统一 提交于 2019-12-24 00:37:02
问题 I'm having difficulties to fully understand the concept of the client creation explained here. I followed the post to set up the OAuthBundle, and tried to make the changes needed to comply with FOSUser. Though I'm not sure it's perfect. My situation My Website is a RESTFul API, which return json or xml only. My frontend will be in AngularJS I combined FOSUser, FOSRest and FOSOAuth, it's possible I'm having errors in the configuration. The Problem I finished setting up the first part of the

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

淺唱寂寞╮ 提交于 2019-12-22 17:49:27
问题 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

Symfony Security: Auth with session or oauth

你说的曾经没有我的故事 提交于 2019-12-18 06:58:03
问题 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

How to implement FosOAuthServerBundle to secure a REST API?

天涯浪子 提交于 2019-12-17 17:24:38
问题 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

FOSOAuthServerBundle + FOSRestBundle + CamelCase = Not authenticating

佐手、 提交于 2019-12-12 05:19:04
问题 I have been working on my server in Symfony 2.8, building a rest api which returns json objects in camelCase style, the problem now is that when I integrate the OauthServer bundle it lauches this error Invalid grant_type parameter or parameter missing" , I understand that this happens because I am using the array_normalizer: fos_rest.normalizer.camel_keys body listener in my fos_rest configuration. Here my code in configuration.yml : fos_rest: #other listeners# body_listener: array_normalizer

Symfony Security FOSOAuthServerBundle public and private routes

谁说胖子不能爱 提交于 2019-12-12 04:23:11
问题 I am using the FOSOAuthBundle for my REST application I would like most of my routes to require authorization however there are a few that should have public access I have the following in my security.yml: security: encoders: FOS\UserBundle\Model\UserInterface: bcrypt role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: ROLE_ADMIN providers: fos_userbundle: id: fos_user.user_provider.username firewalls: oauth_token: pattern: ^/login security: false api: pattern: ^/ fos_oauth: true