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 6786807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:17:21+00:00 2026-05-26T17:17:21+00:00

Is there a way to create a custom security provider without using sessions, using

  • 0

Is there a way to create a custom security provider without using sessions, using my own database class and getting the user from the database with the email and not without haxing the getUsername returning the email ?

  • 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-05-26T17:17:21+00:00Added an answer on May 26, 2026 at 5:17 pm

    You can use SecurityBundle for this, for ex. see example below:

    security.yml

    encoders:
            MyComapnyMysuperBundle\Entity\User:
                algorithm: sha512
                encode-as-base64: true
                iterations: 10
    
        providers:
            main:
                entity: { class: MyComapnyMysuperBundle:User, property: username }
    
        firewalls:
            main:
                pattern: /.*
                form_login:
                    check_path: /login_check
                    login_path: /login
                logout: true
                security: true
                anonymous: true
    
        access_control:
            - { path: /admin/.*, role: ROLE_ADMIN }
            - { path: /.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
    

    you can use doctrine entity as security provide, the yml scheme of user entity for example:

    User.orm.yml

    MyComapny\MysuperBundle\Entity\User:
        type: entity
        table: user
        id:
            id:
                type: integer
                generator: { strategy: AUTO }
        fields:
            username:
                type: string
                length: 255
            password:
                type: string
                length: 255
            first_name:
                type: string
                length: 255
            last_name:
                type: string
                length: 255
            email:
                type: string
                length: 255
            created_at:
                type: datetime
            salt:
                type: string
                length: 255
        manyToMany:
            userRoles:
                targetEntity: Role
                joinTable:
                    name: user_role
                    joinColumns:
                        user_id:
                            referencedColumnName: id
                    inverseJoinColumns:
                        role_id:
                            referencedColumnName: id
    

    and role entity:

    Role.orm.yml

    MyComapny\MysuperBundle\Entity\Role:
        type: entity
        table: role
        id:
            id:
                type: integer
                generator: { strategy: AUTO }
        fields:
            name:
                type: string
                length: 255
            created_at:
                type: datetime
    

    and example of routing.yml

    login:
        pattern:  /login
        defaults: { _controller: MyComapnyMysuperBundle:Security:login }
    
    login_check:
        pattern:  /login_check
    
    logout:
        pattern:  /logout
    
    eTracker_home:
        pattern:  /admin/{name}
        defaults: { _controller: MyComapnyMysuperBundle:Admin:index }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way I could use custom membership provider without need to create
is there a way to create custom post variables when a user presses submit,
Is there some way to create a custom (WoW64) shared registry key? By default
I wonder if there is a way to create a Custom List in Sharepoint,
Is there a way to create a JButton with your own button graphic and
Is there a way to create an html link using h:outputLink, other JSF tag
Is there a way to create an instance of a class based on the
Is there a way to create C# objects and call methods from unmanaged C++,
Is there a way to create custom infowindow in new API V3 of googlemaps.
Is there a way to create a custom field that has multiple input elements?

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.