Hello - I’m trying to write some analytics code to...
# ory-network
l
Hello - I’m trying to write some analytics code to be able to track the number of our users using each OIDC provider. Right now the only way seems to be parsing out the oidc CredentialIdentifers on the identity - and assuming that they are of the form
provider:subject
1. Is this the best way of doing this - or is there another method that I’m missing? 2. Is it documented anywhere that this format of credential identifier is going to remain stable?
s
We don't guarantee it, but it would be very challenging to change them, so I don't expect that to ever happen. But in general, the live events would be the better way to do this, as that contains when each provider was used. I'm just not sure yet if that attribute is available there.
Yeah, it is missing, but it would make sense to add it.
l
Thanks @steep-lamp-91158 - we’re not on the enterprise plan (and probably don’t have the appetite to upgrade to it in the near term). So this parsing is probably the best we can do for now.
s
Sure, makes sense. If it is part of the events though, we can also make it available as a metric in the console (with limited time then). Essentially what providers where used within the last week or so.
l
What our use case is we want to raise events into our own analytics platform on user Registration, with the method that is used. LiveEvents would be the natural place for it, but that’s out of reach right now. We are instead doing this in response to a webhook to us when a user registers. The payload for that can figure out that an OIDC method is used, but there is nothing in the
ctx
for the JSONnet that lets us figure out which provider was used. Hence the flow of fetching the identity - and looking that the OIDC credential identifiers to infer the provider.