Skip to content

Instantly share code, notes, and snippets.

@jmolinap
jmolinap / 1-Explanations.md
Created October 25, 2019 12:47 — forked from danvbe/1-Explanations.md
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pause>1</Pause>
<Number digits="1"/>
<Pause>1</Pause>
<Number digits="2"/>
<Pause>3</Pause>
<Number digits="6786448864"/>
<Pause>2</Pause>
<Number digits="1"/>
{
"type": "generalDataAnswer",
"state": 0,
"data": {
"type": "tenancy",
"coversations-disabled": false,
"created-at": "2016-04-29T12:19:19-06:00",
"dialogs": [
{
"created-at": "2016-05-02T07:05:08-06:00",
package ai.sundown.rest.tenancy;
import ai.sundown.core.WebException;
import ai.sundown.data.*;
import ai.sundown.rest.BadRequestException;
import ai.sundown.rest.*;
import ai.sundown.rest.core.AuthService;
import ai.sundown.rest.core.RestException;
import ai.sundown.utils.Utils;