-
Notifications
You must be signed in to change notification settings - Fork 1
New auth0 role VIAL WB Limited
is not displaying in the Reporters page
#633
Comments
Related to: #612 |
I have a hunch that we don't update the roles we store against reporters often, if ever. We update user roles when they sign into VIAL but reporters works differently. |
Code in question is here - it looks like it should be updating the roles if they have changed but I'm not 100% sure it does: Lines 154 to 240 in 9b6914e
|
Can I get access to auth0 to test this on staging? 👀 |
#access-requests or Jesse should be able to help with that. |
I think the ideal fix here - for both users and reporters - would be if auth0 could somehow inform VIAL any time a user is added or removed from a group using the auth0 interface. I was hoping auth0 would have an obvious mechanism for doing this - maybe a webhooks API that can talk to VIAL, or some kind of customization hook that lets us react in real-time to auth0 configuration changes. Auth0 offer rules and hooks and most recently actions - I would hope that one of these could do this for us, but I've not managed to figure out if it's possible with any of them yet: https://auth0.com/blog/introducing-auth0-actions/ |
I didn't find an action that mapped to a supported event for rules, hooks or actions -- most of these fall in the authentication pipeline between when a user logs in to when a auth token is issued. I did find events that map to a role being added / removed: Event for assigning a role: https://manage.auth0.com/dashboard/us/vaccinateca/logs/90020210605001053900430196618579152991451933976477827074 Event for removing a role: https://manage.auth0.com/dashboard/us/vaccinateca/logs/90020210605001207488430196686485725205025274365420240898 There is a log streaming service available that we can connect to a custom webhook that VIAL can listen to for these type of events, and do its business logic etc. https://auth0.com/docs/monitor-auth0/streams |
Also, there only (thankfully!) 3 users who fall under the WB Trainee role right now: https://manage.auth0.com/dashboard/us/vaccinateca/roles/rol_wxjXHDoqafCt74FM/users |
In the log stream we can filter out API operation events so we are not inundated with logs: b both the role events fall under these codes. |
@simonw We are only allowed one log stream under our current auth0 plan, can I delete this paused webhook: https://manage.auth0.com/dashboard/us/vaccinateca/log-streams/lst_0000000000000810/settings |
@ugotsoul yes let's delete or re-use that one. |
Awesome work figuring this out! It looks like this is the exact mechanism we need. |
Great! The one thing I missed is the log filters are not available in streams yet - the feature is in beta but not appearing in any stream types. :/ |
Hmm it looks like it can be enabled in the dashboard but I'm not seeing it? https://auth0.com/changelog#3ks0rPxzumRAmCfIjcFQYW |
I opened a support ticket for this: https://support.auth0.com/tickets/00490599 |
Yay, this is resolved - auth0 had a safari bug that did not display a popup to opt-in to this beta feature. I used chrome and it worked fine. |
I've been testing an auth0 Webhook for the log stream locally with ngrok and mocking POST requests with postman, and I found out that the event only returns the |
Here's the process of using the auth0 sdk to access the Management API: https://github.com/auth0/auth0-python#management-sdk-usage |
Alternatively, we can use http/s to make calls to the management API: https://auth0.com/docs/tokens/management-api-access-tokens/get-management-api-access-tokens-for-production Note the Management API is separate entity from the OAuth authentication api, but does use JWTs: https://auth0.com/docs/api/management/v2 My thought process for how this would work:
|
Ohh another way we could do this since we know the users roles changed is to simply force the user to logout. Logging back in will update the user's groups. |
discord convo
user affected: https://vial.calltheshots.us/admin/core/reporter/370/change/
The text was updated successfully, but these errors were encountered: