Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-15592

[fiware-stackoverflow] HWIO OAuth bundle on Symfony 4 only redirect to my url and not to OAuth service

    Details

      Description

      Created question in FIWARE Q/A platform on 20-03-2019 at 16:03
      Please, ANSWER this question AT https://stackoverflow.com/questions/55264992/hwio-oauth-bundle-on-symfony-4-only-redirect-to-my-url-and-not-to-oauth-service

      Question:
      HWIO OAuth bundle on Symfony 4 only redirect to my url and not to OAuth service

      Description:
      I am using HWIOAuth bundle to authenticate users using Fiware users identity manager, but each time I try to login it just redirect on the same login page instead of redirecting me on OAuth Fiware login page.

      This is the config for HWIOAuth:

      httplug:
      clients:
      default:
      factory: 'httplug.factory.guzzle6'
      config:
      timeout: 15

      hwi_oauth:

      firewall_names: [secured_area]

      resource_owners:
      fiware:
      type: fiware
      base_url: https://keyrock.****.org
      client_id: 2c87dae1-*******ba35388df068
      client_secret: 55b407********7d6d69f4d

      and this is my security.yaml:

      security:
      encoders:
      FOS\UserBundle\Model\UserInterface: sha512

      role_hierarchy:
      ROLE_ADMIN: ROLE_USER
      ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

      1. https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers

      providers:
      fos_userbundle:
      id: fos_user.user_provider.username

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

      secured_area:
      anonymous: ~
      oauth:
      resource_owners:
      fiware: "/login/check-fiware"
      login_path: /login
      use_forward: false
      failure_path: /login

      oauth_user_provider:
      service: my.oauth_aware.user_provider.service

      1. Easy way to control access for large sections of your site
      2. Note: Only the first access control that matches will be used
        access_control:
      • { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
      1. - { path: ^/(fr|en|zh)/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
      • { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
      • { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
      • { path: ^/admin/, role: ROLE_ADMIN }
      • { path: ^/, role: ROLE_USER }
        • { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }

      access_denied_url: /login

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        11d 14h 25m 1 Alvaro Alonso 01/Apr/19 9:32 AM
        In Progress In Progress Answered Answered
        1s 1 Alvaro Alonso 01/Apr/19 9:32 AM
        Answered Answered Closed Closed
        1s 1 Alvaro Alonso 01/Apr/19 9:32 AM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        aalonsog Alvaro Alonso made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        aalonsog Alvaro Alonso made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        aalonsog Alvaro Alonso made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        HD-Enabler KeyRock [ 10889 ]
        Description
        Created question in FIWARE Q/A platform on 20-03-2019 at 16:03
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55264992/hwio-oauth-bundle-on-symfony-4-only-redirect-to-my-url-and-not-to-oauth-service


        +Question:+
        HWIO OAuth bundle on Symfony 4 only redirect to my url and not to OAuth service

        +Description:+
        I am using HWIOAuth bundle to authenticate users using Fiware users identity manager, but each time I try to login it just redirect on the same login page instead of redirecting me on OAuth Fiware login page.

        This is the config for HWIOAuth:

        httplug:
        clients:
            default:
                factory: 'httplug.factory.guzzle6'
                config:
                    timeout: 15


        hwi_oauth:

        firewall_names: [secured_area]


        resource_owners:
            fiware:
                type: fiware
                base_url: https://keyrock.****.org
                client_id: 2c87dae1-*******ba35388df068
                client_secret: 55b407********7d6d69f4d


        and this is my security.yaml:

        security:
            encoders:
                FOS\UserBundle\Model\UserInterface: sha512

        role_hierarchy:
            ROLE_ADMIN: ROLE_USER
            ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
        # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers

        providers:
            fos_userbundle:
                id: fos_user.user_provider.username

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





            secured_area:
                anonymous: ~
                oauth:
                    resource_owners:
                        fiware: "/login/check-fiware"
                    login_path: /login
                    use_forward: false
                    failure_path: /login


                    oauth_user_provider:
                        service: my.oauth_aware.user_provider.service



        # Easy way to control access for large sections of your site
        # Note: Only the *first* access control that matches will be used
        access_control:
            - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
            # - { path: ^/(fr|en|zh)/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/admin/, role: ROLE_ADMIN }
            - { path: ^/, role: ROLE_USER }
            #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }

        access_denied_url: /login

        Created question in FIWARE Q/A platform on 20-03-2019 at 16:03
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/55264992/hwio-oauth-bundle-on-symfony-4-only-redirect-to-my-url-and-not-to-oauth-service


        +Question:+
        HWIO OAuth bundle on Symfony 4 only redirect to my url and not to OAuth service

        +Description:+
        I am using HWIOAuth bundle to authenticate users using Fiware users identity manager, but each time I try to login it just redirect on the same login page instead of redirecting me on OAuth Fiware login page.

        This is the config for HWIOAuth:

        httplug:
        clients:
            default:
                factory: 'httplug.factory.guzzle6'
                config:
                    timeout: 15


        hwi_oauth:

        firewall_names: [secured_area]


        resource_owners:
            fiware:
                type: fiware
                base_url: https://keyrock.****.org
                client_id: 2c87dae1-*******ba35388df068
                client_secret: 55b407********7d6d69f4d


        and this is my security.yaml:

        security:
            encoders:
                FOS\UserBundle\Model\UserInterface: sha512

        role_hierarchy:
            ROLE_ADMIN: ROLE_USER
            ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
        # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers

        providers:
            fos_userbundle:
                id: fos_user.user_provider.username

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





            secured_area:
                anonymous: ~
                oauth:
                    resource_owners:
                        fiware: "/login/check-fiware"
                    login_path: /login
                    use_forward: false
                    failure_path: /login


                    oauth_user_provider:
                        service: my.oauth_aware.user_provider.service



        # Easy way to control access for large sections of your site
        # Note: Only the *first* access control that matches will be used
        access_control:
            - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
            # - { path: ^/(fr|en|zh)/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
            - { path: ^/admin/, role: ROLE_ADMIN }
            - { path: ^/, role: ROLE_USER }
            #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }

        access_denied_url: /login

        fla Fernando Lopez made changes -
        Assignee Alvaro Alonso [ aalonsog ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2019-03-20 18:06|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2019-03-20 18:06|CREATED monitor | # answers= 0, accepted answer= False
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            aalonsog Alvaro Alonso
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: