Need help with identifying the connection during login

Hi! Im having an issue that I need help with. I created an OIDC enterprise connection by posting to the API using a backchannel specifying issuer settings as documented here. I have a requirement where I need to know if a user’s token originated from this connection and I then need to add a flag in the token to indicate this.

To do this, I created a post login action to read out of event.connection as documented here, hoping that I would get some metadata that I could use to identify the user coming from this source but Im currently not getting anything useful.

I logged the connection object and there isnt much in the metadata,

{
“action_name”: “Test”,
“response”: {
“logs”: “{"id":"removed","metadata":{},"name":"test-backchannel","strategy":"oidc"}\n”,
“stats”: {
“total_request_duration_ms”: 66,
“total_runtime_execution_duration_ms”: 61,
“runtime_processing_duration_ms”: 6,
“action_duration_ms”: 14,
“runtime_external_call_duration_ms”: 41,
“boot_duration_ms”: 47,
“network_duration_ms”: 5
}
},
“started_at”: “2021-07-23T21:01:20.869904560Z”,
“ended_at”: “2021-07-23T21:01:20.936855564Z”
}

Any suggestions on how I can know if a user is coming from a specific connection? Is there a reason why connection details are not present for a connection added through a backchannel?

Please help.

Hi @devops8,

Welcome to the Auth0 Community!

Are you looking for the connection ID? It should be the piece of data you have removed in your example. You can find the corresponding info in the dashboard under Identifier. Like this:

Does that help?

Thank @dan.woda for the reply. I do have the connection id, but is there a way to lookup the connection through an api in the action so I can include something in the token indicating that a user is from that source?

@devops8,

The ID does indicate the source of the user. Can you give an example of the information you would like to see?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.