Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8562853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:49:23+00:00 2026-06-11T16:49:23+00:00

I am trying to setup Symfony2.1 with HWIOAuthBundle to handle google oauth authentication. I

  • 0

I am trying to setup Symfony2.1 with HWIOAuthBundle to handle google oauth authentication.

I have followed manual instructions in bundle description, but still something is missing. When I visit an action which requires authenticated user (or just type url /connect/google) I am redirected to google authentication page – this part is working. But after redirection back (after logging to Google and agree for sharing my data) new user is not created in DB and I am redirected into connect/fail action. Google authentication should be only one way to authenticate user. Any idea what could be wrong?

This is my routing:

hwi_oauth_redirect:
    resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
    prefix:   /connect

google_login:
    pattern: /login/check-google

security.yml

firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    secured_area:
        pattern:    ^/
        form_login:
            provider: fos_userbundle
            login_path: /connect/google
            check_path: /login/login_check
        logout: true
        anonymous: true
        oauth:
            resource_owners:
                google: "/login/check-google"
            login_path:        /connect/google
            failure_path:      /connect-fail
            # FOSUB integration
            oauth_user_provider:
                service: hwi_oauth.user.provider.fosub_bridge

and config

hwi_oauth:
    firewall_name: secured_area
    resource_owners:
            google:
                type:                google
                client_id:           ....
                client_secret:       ......
                scope:               "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
    fosub:
        username_iterations: 5
        properties:
            google: googleId

google redirectURL

http://xxxx/login/check-google

my User entity:

class User extends BaseUser
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var integer $id
     *
     * @ORM\Column(name="google_id", type="integer")
     */ 
    protected $googleId;

//edit- update

I just found in Symfony logs that I had one request from google redirect:
GET http://xxxxx.dk/login/check-google?code=4%2F8tiDAhI45D2g7BvrdtwoF7wJ.Eu7i2fmkYOl05ti8ZT3YDrXXXXXfakeXXXE4hcwI just before redirect to /connect-file
Unfortunately it looks that request only tried to retrieve user from my db based on google_id
SELECT * FROM app_user t0 WHERE t0.googleId = ? LIMIT 1 : [‘123456789’] but that user does not exist there.

Should I create user befor I tryied to authenticate him/her?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:49:24+00:00Added an answer on June 11, 2026 at 4:49 pm

    Sadly, HWIOAuthBundle doesn’t handle automatic registration by default. If you want to login now you’ll have to create the user manually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup and create new bundle with symfony2, but getting so much
I have been trying to setup Symfony2 on Windows so that I can use
I'm trying to use the varnish caching with symfony2. Setup is Varnish -> NGNIX
I have been trying to setup git for our web development team unsuccessfully. Some
I'm trying setup costum storege. Looks like all is ok. But there is the
I'm trying to setup a simple has_many :through => association. I have 3 models.
Trying to setup a simple Thread/Poll table mapping. Here is what I have: Threads
Trying to setup plone2pdf in Plone 4. I have downloaded the Plone2pdf archive, extracted
I have FullCalendar setup up correctly on my page and I am trying to
Trying to setup SSL on jetty 7.2.2 using these instructions: http://docs.codehaus.org/display/JETTY/How+to+configure+SSL stuck on 3b:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.