Skip to content

[keycloak] Can't login after role re-assgin #8567

Closed

Description

@amrita-shrestha

Describe the bug

admin assign role spaceAdmin from keycloak panel to user. Try to log in to ocis with user credential. Most of the time return 500 status code. Sometimes login could be successful
updated bug-report according to commit ocis commit 5f831c0

Steps to reproduce

  1. create user anu on keycloak and assign role User and initiate created user (login to ocis)
  2. user anu logout on ocis
  3. admin re-assigns spaceAdmin role to user anu from keycloak UI
  4. try to log in to ocis with user anu Credential
    Screencast from 4-3-24 04:14:48 अपराह्न +0545.webm

Expected behaviour

login should be successful everytime

Actual behaviour

  1. found that api request on endpoint v1.0/me?%24expand=memberOf returns 500 status code.
       GET https://ocis.owncloud.test/graph/v1.0/me?%24expand=memberOf
    
       Status Code:
       500 Internal Server Error
    
  2. api request on endpoint /v0/settings/roles-list sometimes returns 500 status code and sometimes returns success status code
    Screenshot from 2024-03-04 15-51-52

Setup

run docker-compose up on https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_keycloak

Details

Screenshot from 2024-03-04 16-02-28

Activity

  1. v-scharf commented on Mar 4, 2024

    @v-scharf
    Contributor

    I can confirm this bug. If admin assigns ocisUser role to user anu - works fine

  2. micbar commented on Mar 4, 2024

    @micbar
    Contributor

    admin assigns spaceAdmin role to user anu

    In which UI do you change the role?

  3. amrita-shrestha commented on Mar 5, 2024

    @amrita-shrestha
    ContributorAuthor

    admin assigns spaceAdmin role to user anu

    In which UI do you change the role?

    keycloak UI

  4. micbar commented on Mar 5, 2024

    @micbar
    Contributor

    hm. I cannot reproduce the issue.

  5. v-scharf commented on Mar 5, 2024

    @v-scharf
    Contributor

    I can confirm this bug. If admin assigns ocisUser role to user anu - works fine

    I tested here https://owncloud.dev/ocis/deployment/continuous_deployment/#ocis-with-keycloak and I was confident to reproduce it 500 Error but I couldn't reproduce it together with @micbar

    Steps were:

    Actual: works fine

    I tried to run e2e test with keycloak instance
    KEYCLOAK=true BASE_URL_OCIS=ocis.ocis-keycloak.latest.owncloud.works KEYCLOAK_HOST=keycloak.ocis-keycloak.latest.owncloud.works pnpm test:e2e:cucumber tests/e2e/cucumber/features/smoke/admin-settings/spaces.feature:127 - green

  6. amrita-shrestha commented on Apr 9, 2024

    @amrita-shrestha
    ContributorAuthor

    Steps were:

    @ScharfViktor, instead of "assigning roles while creating a user," we should "change the role" after user creation. I believe this discrepancy in steps might have led to the inability to reproduce the bug.

  7. v-scharf commented on Apr 9, 2024

    @v-scharf
    Contributor

    @ScharfViktor, instead of "assigning roles while creating a user," we should "change the role" after user creation. I believe this discrepancy in steps might have led to the inability to reproduce the bug.

    1. create user anu on keycloak and initiate created user (login to ocis)

    do you assign role ocisUser while creating user anu? I guess so, because anu cannot login without role.

    my actions:

    Screen.Recording.2024-04-09.at.09.14.15.mov

    after changing role -> user can log in

    @amrita-shrestha could you please attach video how to reproduce bug?

  8. changed the title [-][keycloak] Can't login after role assgin[/-] [+][keycloak] Can't login after role re-assgin[/+] on May 27, 2024
  9. amrita-shrestha commented on May 30, 2024

    @amrita-shrestha
    ContributorAuthor

    latest ocis commit 73d7f32 has no such bug so closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions