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

  • SEARCH
  • Home
  • 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 8936731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:16:41+00:00 2026-06-15T10:16:41+00:00

I am working on a REST API using Symfony 2.1. My code works now

  • 0

I am working on a REST API using Symfony 2.1.

My code works now perfectly, but there is problem that I can login in /api/ but this login can work only under /api/*. But I need to have access to whole page.

api:
    pattern: ^/api
    #anonymous: ~
    form_login: false
    provider: fos_userbundle
    http_basic:
        realm: "REST Service"

main:
    pattern: .*
    provider: fos_userbundle
    form_login:
        check_path: fos_user_security_check
        login_path: fos_user_security_login
        default_target_path: wi_homepage
    logout:
        path: fos_user_security_logout
        target: wi_homepage
    anonymous:    true
    switch_user: true
    remember_me:
        key: "%secret%"
        name: RememberMe
        lifetime: 2592000
        remember_me_parameter: _remember_me

So is there any way to make http login under /api/ directory and have access to anywhere?

  • 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-15T10:16:42+00:00Added an answer on June 15, 2026 at 10:16 am

    solution is really simple, there needs to be same context for both firewalls

    context: some_random_context_name_you_can_choose_freely
    

    http://forum.symfony-project.org/viewtopic.php?f=23&t=60654&p=164063#p164063

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

Sidebar

Related Questions

I'm working on a REST API and I really like the idea of using
I'm working on a largely navigation-based iPhone app that communicates with a REST API
I am working on a REST api using Spring-MVC and json. I running my
I'm working with the Azure REST API and they are using this to create
I am using the SharePoint 2010 REST API, which can return data in either
I have basic authentatication working with REST API using curl: curl -X POST -H
I'm working with a REST API that returns a 401 if my authorization token
I'm working with an external REST API that returns some data as a comma-separated
I'm designing a REST API. The part I'm working on now involves simply reading
I'm currently working on a Rest Api using Lift as Framework. Most of the

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.