18F / identity-idp

Login.gov Core App: Identity Provider (IdP)
https://secure.login.gov/
Other
524 stars 112 forks source link

Add app_differentiator field to analytics events #11262

Closed Sgtpluck closed 1 month ago

Sgtpluck commented 1 month ago

🎫 Ticket

https://docs.google.com/document/d/1Leh4LmIf6qPlB95iqfjjy870nx_6QcttoD3eoFIxBGc/edit#heading=h.roxsdyaqcrts We have some partners that are using a brokered integration, with multiple applications behind it.

They are requesting a solution that will allow the fraud team to aggregate data via application.

Updated summary of changes

Based on draft feedback, this change now:

🛠 Summary of changes

This change: - adds an app_identifier field to several IdV analytics events. - this field is determined by request data in the sp_session - IF the sp_session exists, AND there is an original request_url, it parses that request url for the redirect_uri. - IF the redirect_uri exists, it parses that looking for an appIdentifier query param.

Considerations:

matthinz commented 1 month ago

I wonder if this data would be useful outside of the idv events enhancer? We could add it to Analytics::sp_request_attributes and it would get added to all events. https://github.com/18F/identity-idp/blob/main/app/services/analytics.rb#L128-L142

Sgtpluck commented 1 month ago

I wonder if this data would be useful outside of the idv events enhancer? We could add it to Analytics::sp_request_attributes and it would get added to all events. https://github.com/18F/identity-idp/blob/main/app/services/analytics.rb#L128-L142

the fraud team was hoping we could move that way eventually. i will try another commit with that approach!

Sgtpluck commented 1 month ago

@matthinz whaddya think of https://github.com/18F/identity-idp/pull/11262/commits/de71bb141923264b1b64dba433ca8a6fe353b12a ?