It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add user to group is applied after reload page

Hi there!

I have a seraph-plugin to authenticate users via HTML-Headers from a trusted portal.

The problem is, a user be in some groups, sent by this Headers.
So i have in my plugin a groupManager.
I change the Jira-Authentication-Context to an internal Admin with administration-rights, add user to the group(s) with

groupManager.addUserToGroup(applicationUser, group)

and switch back to my user.

 

This is handled on first request (anonymous -> internal admin -> add groups -> anonymous back again)
Anonymous means, there is no user stored in session, but i have a userid in the Headers set. I'm looking for this uid in jira if it exists, and then change to internal-admin and do the rest.

Checking my groups in "Usermanagement" i can see, the user is now in this groups. Playing this game with jira-software-users group shows, that i have no application-access in my current browserwindow (cannot see my tickets). Reloading the window will apply the new groups, and i can see my tickets.

I built in some debug-code:

...
groupManager.addUserToGroup(applicationUser, applicationGroup);
LOGGER.warn("Adding user {} to group {} success?: {}", applicationUser.getName(), applicationGroup.getName(), groupManager.isUserInGroup(applicationUser, applicationGroup.getName()) );
...

Shows in logs "false". User is not added to group marked as "internal-admin" as user for this action.
I also build in between this to lines a loop, to wait for user being added to the group... false.

I watch the logging-file and can see, that in this request the added user to the group is not recognized. it must be another request (for example reload the page in browser) that the plugin recognizes the new groups for the user.

It's almost like in linux, when i add my user to a new group, i have to logout and login again to be in the new group...

How can i resolv this problem? I need the feedback about the new group instantan after adding the user to the group...

Thank you

Jakob

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

314 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you